使一个布局中的所有事件失效
来源:互联网 发布:java前后端分离 vue 编辑:程序博客网 时间:2024/06/07 20:01
当你想要使整个布局只可以看不可以点击滑动等时,如果一个个设置则太麻烦了。
这里用简单代码演示一下:
<LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:text="Button_1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="Button_2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="Button_3" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout>
现想让 LinearLayout 里的所有事件失效
可以这样做
<FrameLayout android:layout_width="match_parent" android:layout_height="match_parent"> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent"> <Button android:text="Button_1" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="Button_2" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:text="Button_3" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <Button android:background="#00000000" android:layout_width="match_parent" android:layout_height="match_parent" /></FrameLayout>
通过桢布局将一个Button浮在最上面,并设置透明,下面的所有控件就被遮住了。
阅读全文
0 0
- 使一个布局中的所有事件失效
- 遍历所有布局中的所有对象
- DrawerLayout抽屉布局item点击事件失效原因之一
- js 如何使事件失效
- js中的所有鼠标事件
- .net Global中的所有事件
- 遍历一个布局里面所有的控件
- 用一个RecyclerView 搞定所有布局
- 使TLB的所有项失效 --- __flush_tlb_all()
- layout布局中的inflate导致属性失效的问题。
- 一个多能的布局,包含了所有用到的布局
- android中的listView的点击事件失效处理
- jquery动态添加节点使事件失效
- mac所有命令失效
- Android4.2 使preinstall中的所有应用正常显示在launcher的默认布局中
- Android4.2 使preinstall中的所有应用正常显示在launcher的默认布局中
- Listview中布局控件导致点击事件失效的原因分析
- listview的子布局如果有HorizontalScrollView、CheckBox 、button,可能会导致onListItemClick点击事件失效。
- (52)多个生产者多个消费者出现的问题,解决方式synchronized方法和Lock方法
- JackSon将json串转成List<Object>,异常com.fasterxml.jackson.databind.JsonMappingException
- faceDetection对比实验
- 关于File.ReadAllText Method (String)
- Spring学习之AOP基础
- 使一个布局中的所有事件失效
- DC-4: 循环结构
- CSS基础知识一
- POJ 3159 Candies 笔记
- 离散傅里叶变换
- 51nod 1453 抽彩球 (思维+排列组合)
- Groovy的JavaBean
- java 多态
- 5-15 计算圆周率 (15分)