美文网首页
view的pointerEvents属性,让view失去点击事件

view的pointerEvents属性,让view失去点击事件

作者: SunnyLYummy | 来源:发表于2018-08-07 16:17 被阅读32次

   /**

    *

    * In the absence of auto property, none is much like CSS's none value. box-none is as if you had applied the CSS class:

    *

    * .box-none {

    *  pointer-events: none;

    * }

    * .box-none * {

    *  pointer-events: all;

    * }

    *

    * box-only is the equivalent of

    *

    * .box-only {

    *  pointer-events: all;

    * }

    * .box-only * {

    *  pointer-events: none;

    * }

    *

    * But since pointerEvents does not affect layout/appearance, and we are already deviating from the spec by adding additional modes,

    * we opt to not include pointerEvents on style. On some platforms, we would need to implement it as a className anyways. Using style or not is an implementation detail of the platform.

    */

    pointerEvents?: "box-none" | "none" | "box-only" | "auto";

   <View pointerEvents={'none'} />

相关文章

网友评论

      本文标题:view的pointerEvents属性,让view失去点击事件

      本文链接:https://www.haomeiwen.com/subject/jejavftx.html