ListView 改成 ScrollView 也是有效果的,但改成RelativeLayout 却不行, 改成 RelativeLayout 嵌套 listview 也是可以得 , 可以 给我一个解释 为啥是这样的吗 ?


<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    xmlns:tools="http://schemas.android.com/tools"    android:layout_width="fill_parent"    android:layout_height="fill_parent"    android:orientation="vertical" >    <RelativeLayout        android:id="@+id/aaa"        android:layout_width="fill_parent"        android:layout_height="50dp"        android:layout_alignParentTop="true"        android:background="@color/black"        android:gravity="top" >        <TextView            android:layout_width="wrap_content"            android:layout_height="wrap_content"            android:layout_centerHorizontal="true"            android:layout_centerVertical="true"            android:text="@string/hello_world"            android:textColor="@color/white"            android:textSize="20sp" />    </RelativeLayout>    <RelativeLayout        android:id="@+id/relativeLayout1"        android:layout_width="fill_parent"        android:layout_height="50dp"        android:layout_alignParentBottom="true"        android:background="@color/grey" >        <EditText            android:layout_width="fill_parent"            android:layout_height="wrap_content" >            <requestFocus />        </EditText>    </RelativeLayout>    <RelativeLayout        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:layout_above="@id/relativeLayout1"        android:layout_below="@id/aaa" >// 将 ListView 改成 ScrollView 也是有效果的,但改成RelativeLayout 却不行,// 改成 RelativeLayout 嵌套 listview 也是可以得 ,        <ListView            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:background="@color/black"            android:visibility="visible" />    </RelativeLayout></RelativeLayout>

更多相关文章

  1. Android-ListView中嵌套(ListView)控件时item的点击事件不起作用
  2. RecyclerView嵌套GridView,RecyclerView的第一个item显示不全
  3. 禁止ScrollView内的控件改变之后自动滚动
  4. Android(安卓)SQLite 支持嵌套事务吗?
  5. Android中Fragment嵌套Fragment,切换Fragment时不显示视图的原因
  6. [Android]通过PhoneLookup读取所有电话号码
  7. android adb usb配置
  8. Android中StackOverflow的问题
  9. Android处理Home键方法小结

随机推荐

  1. Android中ListView的addFooterView不显示
  2. ViewGroups
  3. Android软键盘弹出时把布局顶上去,控件乱
  4. Android(安卓)studio 启动模拟器时解决 V
  5. Android五大布局对象
  6. Android之设置ListView数据显示的动画效
  7. 修改android桌面图标默认大小
  8. android 加载图片
  9. Android(安卓)Studio 配置SVN 及 代码管
  10. Android中density如何设置