界面需要,找到了一种不需要去设置android:windowSoftInputMode属性的解决keyboard和layout不适问题

     有关设置android:windowSoftInputMode的资料,可自行百度。

     我的方法就是,将xml文件的根布局设置成ScrollView,将之前的布局嵌套在里面就行了,不需要去设置以上的任何属性

     在中间没有控件显示的地方,使用view设置weight去占位置

    下面给出我的xml布局

    

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="match_parent"    android:layout_height="match_parent"    android:fillViewport="true"    tools:context="com.example.richedit.TestInputMethodActivity" >    <LinearLayout         android:layout_width="fill_parent"        android:layout_height="fill_parent"        android:orientation="vertical">        <LinearLayout             android:layout_width="fill_parent"            android:layout_height="40dp"            android:background="#332423">                    LinearLayout>        <View android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"/>        <EditText             android:layout_width="match_parent"            android:layout_height="wrap_content"/>        <EditText             android:layout_width="match_parent"            android:layout_height="wrap_content"/>        <View             android:layout_width="match_parent"            android:layout_height="0dp"            android:layout_weight="1"/>        <RelativeLayout             android:layout_width="fill_parent"              android:layout_height="54dip"              android:background="@android:drawable/bottom_bar">            <Button                  android:id="@+id/manual_setup"                  android:text="zuozuo"                  android:layout_height="wrap_content"                  android:layout_width="wrap_content"                  android:minWidth="100dp"                  android:layout_alignParentLeft="true"                  android:layout_centerVertical="true" />              <Button                  android:id="@+id/next"                  android:text="youyou"                  android:layout_height="wrap_content"                  android:layout_width="wrap_content"                  android:minWidth="100dp"                  android:layout_alignParentRight="true"                  android:layout_centerVertical="true" />          RelativeLayout>    LinearLayout>ScrollView>

 

   这里给出keyb弹出时和没弹出时的效果图,很好的将底部栏顶了上去

  

             

 

转载于:https://www.cnblogs.com/robben/p/4832618.html

更多相关文章

  1. Android虚拟导航栏遮挡底部的输入框的解决方法
  2. 详解Android中获取SD卡和内存的空间信息
  3. [置顶] Android(安卓)中轴时光轴
  4. android 阻尼效果(图片下拉变大)
  5. Android(安卓)shape属性详细整理
  6. Android(安卓)Adapter适配器
  7. Android中TextView控件的singleLine废弃解决
  8. android ListView美化-->几个比较特别的属性
  9. Android移动应用开发基础2003291341

随机推荐

  1. Android处理后台返回数据——Json转实体
  2. Android(安卓)Studio中同步代码时报:Recei
  3. android sqlite
  4. Android设计中的.9.png
  5. android:scaleType属性
  6. 让Ubuntu和Android同时运行(Ubuntu on And
  7. Android(安卓)增加中文字体
  8. android WebView总结
  9. Android之EditText 属性汇总
  10. Android中屏幕相关的操作