-1

怎么把屏幕分成两半??如何在此布局下方添加图像?这将捕获全屏我想添加 bwlow 这个布局一个包含一些文本视图或图像的布局我怎么做?我想将全屏设置为一半并在此布局下方添加新的 latout 我该怎么做?像这张图片 http://imgur.com/dlXCoCu 但屏幕看起来像这样 http://imgur.com/4WRxONf

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/db1_root"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#333333"
android:orientation="horizontal" >

<LinearLayout
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:layout_marginBottom="1dp"

    android:layout_marginTop="1dp"
    android:layout_weight="1"
    android:background="#ffffff"
    android:orientation="vertical" >

    <ImageView
        android:id="@+id/imageView1"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="0.3"
        android:paddingLeft="1dp"
        android:src="@drawable/ic_launcher" />

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="20dp"
        android:layout_weight="0.1"
        android:paddingTop="5dp"
        android:text="CONTAINS"
        android:textColor="#000000"
        android:textSize="10dip" />





     <com.schoollunchapp.HorizontalListView
           android:id="@+id/listview"
           android:layout_width="wrap_content"
           android:layout_height="0dp"
              android:layout_weight="0.6"

           android:background="#ddd" >

</com.schoollunchapp.HorizontalListView>








 </LinearLayout>

 <TextView
    android:id="@+id/imageView1"
    android:layout_width="0dp"
    android:layout_height="wrap_content"
    android:layout_weight="1"
    android:paddingLeft="1dp"
    android:textColor="#ffffff"
    android:text="kurdfgkjdfuhfudshfkdshfdfhs
 kdjhfjdshfkjdshfkdshfkshjdhfskjhfksdhfksjhfkjsdhfkjsdhfk
 jshfshfshfdshdfshdkjfhsafkjsahdfksahdf" />

4

1 回答 1

0

您是否尝试过将 TextView 放在另一个线性布局中,该布局也嵌套在您的容器布局中并给出

android:layout_weight="1"

? 您也可以查看这个 SO question

于 2013-07-17T17:29:08.750 回答