取消自动获取焦点(默认进来焦点到edittext),取消进入呼出软件盘

博客分类: 

 
Xml代码   收藏代码
  1. <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content"  
  2.                 android:id="@+id/checkinlinear" android:layout_below="@id/assetnameet"  
  3.                 android:focusable="true"  android:focusableInTouchMode="true"  
  4.                 android:lineSpacingExtra="5dip">  
  5.         
  6.       <EditText android:id="@+id/checkin_content" android:layout_height="50dip" android:layout_width="200dip"  
  7.                 android:layout_weight="1" android:hint="@string/checkin_content_hint" android:singleLine="true"/>  
  8.       
  9.       <Button android:text="@string/checkin_submit_btn" android:id="@+id/checkin_submitbtn"  
  10.               android:layout_height="wrap_content" android:layout_width="wrap_content"  
  11.               android:layout_weight="3"/>  
  12.   </LinearLayout>  

 android:focusable="true"  android:focusableInTouchMode="true"

 

此前,当我进入做项目的时候!发现,当我进入到对应的ui中,焦点会自动的到edittext中,这样就会呼出软键盘!我在网上找了一些资料!有的是关闭,或者监控软键盘状态,或者焦点位置!

   但是!这些都不是我项目想要的!

  我想要的仅仅是第一次进入到对应ui的时候,不要呼出软键盘,当用户点击的时候,才呼出软键盘!

 

 

 而在linearyout中加入这两行代码就能实现我的要求了了!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值