Как мне сделать такой макет? Заголовок не должен прокручиваться и должен быть всегда видимым.
![enter image description here](https://i.stack.imgur.com/VzDGG.png)
Дело в том, что Android выдает ошибку, когда я пытаюсь вставить ScrollView
в LinearLayout
.
Markup:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/baseLayout">
<LinearLayout
style="@style/app_header" />
<ScrollView
style="@style/fillParent">
<!-- elements here -->
</ScrollView>
</LinearLayout>
Стили:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="app_theme" parent="android:Theme">
</style>
<style name="fillParent">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
</style>
<style name="fullWidth">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">wrap_content</item>
</style>
<style name="wrapContent">
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">wrap_content</item>
</style>
<style name="baseLayout" parent="fillParent">
<item name="android:orientation">vertical</item>
<item name="android:background">@drawable/app_bg</item>
</style>
<style name="app_header" parent="fullWidth">
<item name="android:background">@drawable/header_bg</item>
</style>
</resources>