Android输入框被键盘遮挡

来源:互联网 发布:公司网络屏蔽视频 斗鱼 编辑:程序博客网 时间:2024/05/01 16:10

解决方案:

在我们的LinearLayout布局外添加ScrollView 

 

示例:

 

由原来的:

 

view plainprint?
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:layout_width="fill_parent"  
  4.     android:layout_height="fill_parent">  
  5.       
  6.     ......  
  7.           
  8. </LinearLayout>  
 

改为:

 

view plainprint?
  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"   
  3.     android:orientation="vertical"  
  4.     android:layout_width="fill_parent"   
  5.     android:layout_height="fill_parent">  
  6. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  7.     android:layout_width="fill_parent"  
  8.     android:layout_height="fill_parent">  
  9.       
  10.     ......  
  11.           
  12. </LinearLayout>  
  13. </ScrollView>  


 


原创粉丝点击