zoukankan      html  css  js  c++  java
  • Android ListView嵌套Button,Button事件覆盖item事件解决办法

    方法就是修改item布局的xml文件:
    
    在根布局里加上:
       android:descendantFocusability="blocksDescendants" 
    
    然后在按钮布局里加上:
       android:focusable="false"</strong> 
    
    item和按钮都 可以点了,就OK了
    
    下面是布局示例:
    
    
        <?xml version="1.0" encoding="utf-8"?>  
        <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
            android:layout_width="match_parent"  
            android:layout_height="match_parent"  
            android:orientation="vertical"   
            android:descendantFocusability="blocksDescendants"  
    
    [html] view plaincopy
    
            <Button  
                       android:id="@+id/worklog_update"  
                       android:layout_width="wrap_content"  
                       android:layout_height="wrap_content"  
                       android:text="修改"   
                       android:focusable="false"  
                       />  
              
                   <Button  
                       android:id="@+id/worklog_del"  
                       android:layout_width="wrap_content"  
                       android:layout_height="wrap_content"  
                       android:text="删除"   
                       android:focusable="false"  
                       /> 
  • 相关阅读:
    Apache 虚拟主机 VirtualHost 配置
    ajax无线级刷新
    Apache中 RewriteRule 规则参数介绍
    用户注册
    用户登录
    Android 侧滑菜单
    PhontoShop CS6 视频
    ArcGis地图
    Android 汉子转换成拼音
    UTF-8 转 GBK
  • 原文地址:https://www.cnblogs.com/tianshidechibang234/p/3441113.html
Copyright © 2011-2022 走看看