当前位置:网站首页>适配华为机型中出现的那些坑
适配华为机型中出现的那些坑
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>后面如果还遇到其他的继续补充。。。待续
边栏推荐
- Generic functions in kotlin
- leetcode:19. 删除链表的倒数第 N 个结点
- Given a two-dimensional list of m*n, find out whether a number exists
- 如何监听DOM元素尺寸的变化?
- MySQL filter query (start with a letter, start with a number, start without a number, and start without a letter)
- Two image enhancement methods: image point operation and image graying
- Introduction to testing - Software Test Model
- TiDB、mysql修改系统变量/常用语句(杀死process中的进程)
- 4.4 Eval function replaces function
- Markdown rule for writing articles
猜你喜欢

2022-2028 global boom cylinder industry research and trend analysis report
![[yuanuniverse 3D competition]](/img/5e/386d2299ba62a78bd73982997d4df9.png)
[yuanuniverse 3D competition]

Showctf web primer series

STL tutorial 3- type conversion static_ cast、dynamic_ cast、const_ cast、reinterpret_ Cast method

showCTF 入门文件包含系列

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

Redis master-slave vulnerability and remote connection vulnerability

Classic topics of leetcode array (I)

Showctf starter file contains series

TiDB3.0- 4.0 内存控制/修改日志保存天数/最大索引长度
随机推荐
Figure out how MySQL works
Unity开发相关的博客收集
GQL+Nodejs+MySQL数据库
Topic34——31. 下一个排列
Unity写多线程注意事项
CTF show WEB10
Ads Filter Design Wizard tool I
[MySQL performance optimization] - optimize query
PS prompts "script error -50 general Photoshop error, how to solve it?
Requirements for setting up points sign in tasks and common problems in the process of building points mall
[yuanuniverse 3D competition]
Abstractqueuedsynchronizer (AQS) source code detailed analysis - semaphore source code analysis
Abstractqueuedsynchronizer (AQS) source code detailed analysis - countdownlatch source code analysis
Decrypt FTP
5 minutes to understand MySQL - row to column
How to build a deep learning framework?
Given a two-dimensional list of m*n, find out whether a number exists
Eureka's timedsupersortask class (periodic task with automatic interval adjustment)
showCTF 入门文件包含系列
Audio immersive experience