当前位置:网站首页>适配华为机型中出现的那些坑
适配华为机型中出现的那些坑
2022-06-21 08:33:00 【WCanTouch】
首先吐槽一下华为机子的兼容性真是差,如果满分是10分的话,顶多打3分。
1.华为机型中最常见的就是listview点击无响应;
这是由于如果item.xml里面包括button或者checkbox等控件,默认情况下list的item会失去焦点,导致无法响应item的事件,最常用的解决办法是在tem.xml的布局文件中设置descendantFocusability属性。
beforeDescendants:viewgroup会优先其子类控件而获取到焦点
afterDescendants:viewgroup只有当其子类控件不需要获取焦点时才获取焦点
blocksDescendants:viewgroup会覆盖子类控件而直接获得焦点
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:descendantFocusability="blocksDescendants"><!--添加这个属性-->
<checkBox>...
<Button>...
</LinearLayout>后面如果还遇到其他的继续补充。。。待续
边栏推荐
猜你喜欢

怎么搭建深度学习框架?

Fd: file descriptor

How to build a deep learning framework?

Tsinghua University | van: visual attention network

Abstractqueuedsynchronizer (AQS) source code analysis - cyclicbarrier source code analysis

Eureka's timedsupersortask class (periodic task with automatic interval adjustment)

Qsort sort string

【VS】【使用问题】【解决方案】VS2010打开一直停留在启动界面

Ads Filter Design Wizard tool 2

Using the method of combining shapes in illustrator
随机推荐
Unity中.Meta文件作用详解
面试经验---字节
Unmanned, automation technology affects the world
Classic topics of leetcode array (I)
STL教程3-类型转换static_cast、dynamic_cast、const_cast、reinterpret_cast方法
STL教程2-MyArray框架实现
优化食品生产行业库存管理的6种方法
AQS source code exploration_ 01 handwriting a simplified reentrantlock reentrant lock
Ads Filter Design Wizard tool I
【MGT】代码解读之model-MGT
2022-2028 global postoperative pressure suit industry research and trend analysis report
Unity开发相关的博客收集
Base de données de sauvegarde DumpLiNg
Client construction and Optimization Practice
nodejs的post请求json类型及表单类型
Audio immersive experience
Use lua+redis+openresty to realize concurrent optimization of e-commerce Homepage
给两个字符串s和t,判断t是否为s的重新排列后组成的单词
Reading method (three times reading method)
sql查看数据库/表磁盘占用情况,杀死进程终止tidb中的连接