1

Примерная верстка.

<ScrollView android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:id="@+id/mainScroller">
    <LinearLayout
        android:orientation="vertical"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:id="@+id/mainLayout">
    <View
        android:layout_width="match_parent"
        android:layout_height="@dimen/horLineHeight"
        android:background="@color/vColor"
        android:layout_weight="2"
        android:layout_gravity="center">
    </View>
</LinearLayout>
</ScrollView>
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_gravity="bottom"
    android:paddingRight="@dimen/textMargin"
    android:paddingLeft="@dimen/textMargin"
    android:paddingBottom="@dimen/textMargin"
    android:gravity="bottom"
    android:id="@+id/footerRelative">
    <Button
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:id="@+id/btnSearch"
        android:layout_alignParentBottom="true"
        style="@style/btnStyle"
        android:gravity="center"/>
</RelativeLayout>

В портретном режиме все нормально, а когда поворачивааешь, скролл нормально работает, а кнопки нету, вообще! Что не так?

1
  • 1
    Добавьте родительский layout для вышенаписанного кода 23 янв 2016 в 10:50

1 ответ 1

1

Вот что мне помогло, может и кому поможет...

<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingRight="@dimen/textMargin"
android:paddingLeft="@dimen/textMargin"
android:paddingBottom="@dimen/textMargin"
android:id="@+id/footerRelative">
<ScrollView android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:id="@+id/mainScroller">
<LinearLayout
    android:orientation="vertical"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:id="@+id/mainLayout">
<View
    android:layout_width="match_parent"
    android:layout_height="@dimen/horLineHeight"
    android:background="@color/vColor"
    android:layout_weight="2"
    android:layout_gravity="center">
</View>
</LinearLayout>
</ScrollView>
<Button
    android:layout_width="match_parent"
    android:layout_height="55dp"
    android:id="@+id/btnSearch"
    android:layout_alignParentBottom="true"
    style="@style/btnStyle"
    android:gravity="center"/>
</RelativeLayout>

Ваш ответ

By clicking “Отправить ответ”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Всё ещё ищете ответ? Посмотрите другие вопросы с метками или задайте свой вопрос.