如何在android中设置地图视图的半屏幕listview
这是我的XMl,我试图在半屏幕上显示listview,然后它应该滚动它的项目,基本上我只想显示3个项目。 目前我的屏幕是这样的 虽然我必须只显示列表视图半屏幕,请告诉我哪里做错了,我必须显示列表视图半屏幕,其中我只想显示3项如何在android中设置地图视图的半屏幕listview,android,Android,这是我的XMl,我试图在半屏幕上显示listview,然后它应该滚动它的项目,基本上我只想显示3个项目。 目前我的屏幕是这样的 虽然我必须只显示列表视图半屏幕,请告诉我哪里做错了,我必须显示列表视图半屏幕,其中我只想显示3项 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:l
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/contact_relMainHeader"
android:layout_width="match_parent"
android:layout_height="55dip"
android:background="#00ad9a"
android:padding="5dp" >
<ImageView
android:id="@+id/contact_btnMenu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_marginBottom="9dip"
android:layout_marginTop="9dip"
android:src="@drawable/backbutton" />
<ImageView
android:id="@+id/textView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginBottom="3dip"
android:layout_marginTop="3dip"
android:gravity="center"
android:src="@drawable/centertext" />
</RelativeLayout>
<LinearLayout
android:id="@+id/Llayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/contact_relMainHeader"
android:background="@android:color/transparent"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/Rlayout"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1" >
<LinearLayout
android:id="@+id/contact_linearHeader1"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<com.lociiapp.MapWrapperLayout
android:id="@+id/map_relative_layout"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<fragment
android:id="@+id/map"
android:layout_width="match_parent"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
<TextView
android:id="@+id/lastSeenDatetextview"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:text="Time"
android:textAppearance="?android:attr/textAppearanceLarge" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:orientation="horizontal"
android:background="#07000000"
android:gravity="bottom">
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" >
</ListView>
<TextView
android:id="@+id/typing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000" />
</LinearLayout>
</com.lociiapp.MapWrapperLayout>
</LinearLayout>
<com.lociiapp.utils.RoundedImageView
android:id="@+id/recciverImage"
android:layout_width="60dip"
android:layout_height="60dip"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:src="@drawable/imge" />
</RelativeLayout>
<LinearLayout
android:id="@+id/llout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/Rlayout"
android:gravity="bottom"
android:orientation="horizontal" >
<EditText
android:id="@+id/txt_inputText"
android:layout_width="match_parent"
android:layout_height="50dip"
android:layout_weight="0.86"
android:background="@drawable/backgroundline"
android:focusableInTouchMode="true"
android:hint="Write Message"
android:paddingLeft="20dp"
android:textColor="#ababab" />
<Button
android:id="@+id/btn_Send"
android:layout_width="79dp"
android:layout_height="50dip"
android:background="#ededed"
android:text="Send"
android:textColor="#000000" />
</LinearLayout>
</LinearLayout>
</RelativeLayout>
替换此项,根据给定屏幕设置线性布局的高度,并享受
<LinearLayout
android:layout_width="match_parent"
android:layout_height="120dip"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:background="#07000000"
android:gravity="bottom"
android:orientation="horizontal" >
<ListView
android:id="@+id/listView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" >
</ListView>
<TextView
android:id="@+id/typing"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000" />
</LinearLayout>