【发布时间】:2014-08-19 17:59:10
【问题描述】:
我正在尝试为相对布局中的线性布局提供滚动视图,实际上线性布局用于膨胀 textview 和按钮,但在进行更改后我也没有得到滚动条请帮助我这是我的 xml 文件请求e帮助我我是android的新手
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:fillViewport="true" >
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<EditText
android:id="@+id/editText1"
android:layout_width="150dp"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:ems="10"
android:hint="Search item" />
<EditText
android:id="@+id/editText2"
android:layout_width="80dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_toRightOf="@+id/editText1"
android:ems="10"
android:hint="Qty"
android:inputType="numberDecimal" >
<requestFocus />
</EditText>
<Button
android:id="@+id/add_to_bill"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/editText2"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:text="Add"
android:textSize="20sp" />
<ListView
android:id="@+id/list"
android:layout_width="match_parent"
android:layout_height="175dp"
android:layout_above="@+id/textView1"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1" >
</ListView>
<LinearLayout
android:id="@+id/billshow"
android:layout_width="wrap_content"
android:layout_height="120dp"
android:layout_above="@+id/submit_bill"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:orientation="vertical" >
</LinearLayout>
<Button
android:id="@+id/submit_bill"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="15dp"
android:text="Submit" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/billshow"
android:layout_alignParentLeft="true"
android:text="Item"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/billshow"
android:layout_alignRight="@+id/editText1"
android:layout_marginRight="14dp"
android:text="Price"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/submit_bill"
android:layout_below="@+id/list"
android:text="Qty"
android:textAppearance="?android:attr/textAppearanceLarge" />
</RelativeLayout>
【问题讨论】:
标签: android scrollview android-linearlayout android-relativelayout