<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:background="@android:color/white"
android:layout_height="match_parent">
<include
android:id="@+id/header"
layout="@layout/header"/>
<RelativeLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/header" >
<ScrollView
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/insurance"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co." />
<EditText
android:id="@+id/insuranceBranch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co.Branch" >
</EditText>
<Spinner
android:id="@+id/insuranceProduct"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:layout_marginBottom="10dp"/>
<EditText
android:id="@+id/policyNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Policy Number" >
</EditText>
<EditText
android:id="@+id/idv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="IDV/SI" >
</EditText>
<EditText
android:id="@+id/registrationNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Registration Number" >
</EditText>
<EditText
android:id="@+id/makeAndModel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Make and Model" >
</EditText>
<EditText
android:id="@+id/manufacturingYear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Manufacturing Year" >
</EditText>
<EditText
android:id="@+id/insuranceRemark"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Remark" >
</EditText>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:weightSum="1"
android:background="@android:color/white"
android:orientation="horizontal">
<Button
android:id="@+id/add"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:text="Add"/>
<Button
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:text="Cancel"/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
0
A
ответ
0
Попробуйте положить match_parent для layout_height для ScrollView
0
// try this
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:background="@android:color/white"
android:orientation="vertical"
android:padding="5dp"
android:layout_height="match_parent">
<include
android:id="@+id/header"
layout="@layout/header"/>
<ScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginTop="5dp"
android:layout_weight="1">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/insurance"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co." />
<EditText
android:id="@+id/insuranceBranch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co.Branch" >
</EditText>
<Spinner
android:id="@+id/insuranceProduct"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:layout_marginBottom="10dp"/>
<EditText
android:id="@+id/policyNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Policy Number" >
</EditText>
<EditText
android:id="@+id/idv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="IDV/SI" >
</EditText>
<EditText
android:id="@+id/registrationNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Registration Number" >
</EditText>
<EditText
android:id="@+id/makeAndModel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Make and Model" >
</EditText>
<EditText
android:id="@+id/manufacturingYear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Manufacturing Year" >
</EditText>
<EditText
android:id="@+id/insuranceRemark"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Remark" >
</EditText>
</LinearLayout>
</ScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:layout_marginTop="5dp"
android:orientation="horizontal">
<Button
android:id="@+id/add"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Add"/>
<Button
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Cancel"/>
</LinearLayout>
</LinearLayout>
0
макет будет прокручиваться теперь только добавил андроид: layout_above = "@ + идентификатор/addcancel_layout" один из ваших Scrollview элемент скрывается на задней части LinearLayout
<include
android:id="@+id/header"
layout="@layout/header"/>
<RelativeLayout
android:id="@+id/content"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@id/header" >
<ScrollView
android:layout_above="@+id/addcancel_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<EditText
android:id="@+id/insurance"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co." />
<EditText
android:id="@+id/insuranceBranch"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Co.Branch" >
</EditText>
<Spinner
android:id="@+id/insuranceProduct"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingLeft="5dp"
android:layout_marginBottom="10dp"/>
<EditText
android:id="@+id/policyNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Policy Number" >
</EditText>
<EditText
android:id="@+id/idv"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="IDV/SI" >
</EditText>
<EditText
android:id="@+id/registrationNumber"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Registration Number" >
</EditText>
<EditText
android:id="@+id/makeAndModel"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Make and Model" >
</EditText>
<EditText
android:id="@+id/manufacturingYear"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Manufacturing Year" >
</EditText>
<EditText
android:id="@+id/insuranceRemark"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:hint="Insurance Remark" >
</EditText>
</LinearLayout>
</ScrollView>
<LinearLayout
android:id="@+id/addcancel_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:weightSum="1"
android:background="@android:color/white"
android:orientation="horizontal">
<Button
android:id="@+id/add"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:text="Add"/>
<Button
android:id="@+id/cancel"
android:layout_width="0dp"
android:layout_height="fill_parent"
android:layout_weight="0.5"
android:text="Cancel"/>
</LinearLayout>
</RelativeLayout>
Смежные вопросы
- 1. RelativeLayout внутри scrollview не прокручивается
- 2. ScrollView с суб RelativeLayout не прокручивается
- 3. ScrollView не прокручивается?
- 4. ScrollView не прокручивается?
- 5. Android ScrollView не прокручивается
- 6. Android: ScrollView не прокручивается
- 7. ScrollView не прокручивается до конца.
- 8. ScrollView не прокручивается в конец
- 9. Мой scrollView не прокручивается?
- 10. Scrollview, который не прокручивается
- 11. Listview не прокручивается внутри scrollview
- 12. Scrollview прокручивается после содержимого
- 13. Android: Scrollview больше не прокручивается
- 14. ScrollView не прокручивается
- 15. ScrollView не плавно прокручивается
- 16. ScrollView полностью не прокручивается
- 17. Scrollview полностью не прокручивается
- 18. ScrollView не прокручивается вообще
- 19. Relativelayout внутри Scrollview не работает
- 20. ScrollView не отображается в RelativeLayout
- 21. ScrollView внутри фрагмента не прокручивается
- 22. RelativeLayout scrollview
- 23. Datepicker не прокручивается в scrollview
- 24. scrollview не прокручивается в iphone
- 25. Scrollview не прокручивается в Linearlayout?
- 26. Scrollview в RelativeLayout --android
- 27. Центр RelativeLayout в Scrollview
- 28. centerHorizontal RelativeLayout в ScrollView
- 29. Scrollview не прокручивается, когда появляется клавиатура
- 30. Относительная компоновка не прокручивается после добавления scrollview
Возможно, вы должны сначала разместить ScrollView, а затем Relative Layout. См. Ответы: http: //stackoverflow.com/questions/7714442/how-can-i-use-scrollview-with-relative-layout и http://stackoverflow.com/questions/4657687/relativelayout-scrollview – pandabear
Вы должны установите высоту ScrollView. Не использовать содержимое обертки – Subbu