Android 滚动视图内容在底部栏中不可见
我的布局有一个Android 滚动视图内容在底部栏中不可见,android,android-layout,Android,Android Layout,我的布局有一个滚动视图和一个固定的底部栏 在添加带有两个按钮的底部栏后,ScrollView项将不可见 我尝试更改父布局,但不起作用 请在下面查找代码 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layou
滚动视图和一个固定的底部栏
在添加带有两个按钮的底部栏后,ScrollView
项将不可见
我尝试更改父布局,但不起作用
请在下面查找代码
<?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:background="#fff">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="2"
>
<Button
android:id="@+id/bottombar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="Add to Cart "
android:textColor="@color/White"
android:textStyle="bold" />
<Button
android:id="@+id/bottombar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="Buy Now "
android:textColor="@color/White"
android:textStyle="bold" />
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_below="@id/toolbar"
android:background="#fff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical"
>
<TextView
android:id="@+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textColor="#000"
android:textSize="20dp" />
<ImageView
android:id="@+id/image_full"
android:layout_width="220dp"
android:layout_height="300dp"
android:layout_gravity="center"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:id="@+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="20dp"
android:text="Price"
android:textColor="#000"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:id="@+id/text_des"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Full details"
android:textColor="#000"
android:textSize="20dp" />
</LinearLayout>
</ScrollView>
任何帮助都将是巨大的
谢谢。在滚动视图中给出
android:layout_above="<Id of your linear layout that contains two buttons>"
android:layout_over=“”
仅指定下面的工具栏将使滚动视图拉伸到屏幕底部。
还要确保按钮的线性布局不会拉伸整个屏幕。如下所示:
<?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:background="#fff">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<LinearLayout
android:id="@+id/btm_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:orientation="horizontal"
android:weightSum="2"
>
<Button
android:id="@+id/bottombar1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="Add to Cart "
android:textColor="@color/White"
android:textStyle="bold" />
<Button
android:id="@+id/bottombar2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:background="@color/colorPrimary"
android:text="Buy Now "
android:textColor="@color/White"
android:textStyle="bold" />
</LinearLayout>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_above="@+id/btm_bar_layout"
android:layout_below="@id/toolbar"
android:background="#fff">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#fff"
android:orientation="vertical"
>
<TextView
android:id="@+id/text_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Name"
android:textColor="#000"
android:textSize="20dp" />
<ImageView
android:id="@+id/image_full"
android:layout_width="220dp"
android:layout_height="300dp"
android:layout_gravity="center"
android:padding="20dp"
android:scaleType="fitXY" />
<HorizontalScrollView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:scrollbars="none">
<LinearLayout
android:id="@+id/imageall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"></LinearLayout>
</HorizontalScrollView>
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/price_full"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="20dp"
android:text="Price"
android:textColor="#000"
android:textSize="20dp"
android:textStyle="bold" />
</RelativeLayout>
<TextView
android:id="@+id/text_des"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="Full details"
android:textColor="#000"
android:textSize="20dp" />
</LinearLayout>
</ScrollView>