【发布时间】:2016-08-17 12:12:48
【问题描述】:
我的 .xml 上的滚动视图正在工作,但它在工具栏上重叠我无法再按层次结构,如果这是问题,我刚刚将我的 android studio 更新到 2.2 Beta idk。
在这里。
<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"
tools:context="com.example.kun.carkila.DetailActivity"
tools:showIn="@layout/activity_detail">
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/etResDate"
android:editable="false"
android:hint="Reservation Date"
android:layout_below="@+id/etPickup"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/etResTime"
android:editable="false"
android:hint="Reservation Time"
android:layout_below="@+id/etResDate"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:inputType="textPersonName"
android:ems="10"
android:id="@+id/etPickup"
android:hint="Pickup Location"
android:layout_below="@+id/tvPoster"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_marginTop="22dp"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/etReturnTime"
android:editable="false"
android:hint="Return Time"
android:layout_below="@+id/etReturnDate"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Rent"
android:id="@+id/btnRent"
android:layout_below="@+id/etReturnTime"
android:layout_centerHorizontal="true" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/ivImage"
android:src="@android:drawable/star_big_on"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvCarModel"
android:layout_below="@+id/ivImage"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvCarType"
android:layout_below="@+id/tvCarModel"
android:layout_alignLeft="@+id/tvCarModel"
android:layout_alignStart="@+id/tvCarModel" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvCapacity"
android:layout_below="@+id/tvCarType"
android:layout_alignLeft="@+id/tvCarType"
android:layout_alignStart="@+id/tvCarType" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvFuelType"
android:layout_below="@+id/tvCapacity"
android:layout_centerHorizontal="true" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvPoster"
android:layout_below="@+id/tvPlateNumber"
android:layout_alignLeft="@+id/tvPlateNumber"
android:layout_alignStart="@+id/tvPlateNumber" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceLarge"
android:text="Large Text"
android:id="@+id/tvPlateNumber"
android:layout_below="@+id/tvFuelType"
android:layout_alignLeft="@+id/tvFuelType"
android:layout_alignStart="@+id/tvFuelType" />
<EditText
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/etReturnDate"
android:editable="false"
android:hint="Return Date"
android:layout_below="@+id/etResTime"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:layout_alignParentRight="true"
android:layout_alignParentEnd="true" />
</RelativeLayout>
【问题讨论】:
-
请提供屏幕截图。
-
@AmitVaghela - 我更新了忘记添加滚动视图的代码。对不起。
-
@jaydroider - 先生,我已经更新了屏幕截图。 :)
-
@J.Shmoe 为什么你拿了这个
app:layout_behavior="@string/appbar_scrolling_view_behavior"删除它并检查。 -
@jaydroider - 现在好了,先生。我只是将
app:layout_behavior="@string/appbar_scrolling_view_behavior"放在滚动视图上而不是相对布局上。谢谢你,先生!请将评论转换为答案。 :)
标签: android scrollview android-relativelayout