私は持っているLinearLayout内部を持ってScrollViewいますがandroid:layout_height="fill_parent"、それは完全な高さに拡張しませんScrollView。私のレイアウトは次のようになります:
level    layout    layout_width    layout_height
1    LinearLayout    fill_parent    fill_parent
2    LinearLayout    fill_parent    wrap_content
3    (some irrelevant stuff)
2    ScrollView      fill_parent    fill_parent <-- this expands full height
3    LinearLayout    fill_parent    fill_parent <-- this does not (has orientation=vertical)
(following stuff probably are irrelevant, but just to be sure:)
4    TextView        fill_parent    fill_parent
4    LinearLayout    fill_parent    wrap_content
私はそれを見ることができるLinearLayoutの完全な高さを拡張しませんScrollViewEclipseでであるためAndroid Layout Editor、私は選択した場合、ScrollView(アウトライン]パネルで)それが下に画面いっぱいに赤枠で強調表示されますが、私が選択したときにLinearLayoutそのハイライトを画面の下部まで拡大されません。どうすればそれを実現できますか?
私が達成しようとしている効果は、テキストとその下にボタンがあることです(LinearLayoutレベル4 内にはボタンがあります)。テキストはスクロールバーを必要とするほど大きい場合があります。その場合、ボタンを表示するためにユーザーが下にスクロールする必要があります。テキストがスクロールバーに十分な大きさでない場合はLinearLayout、ボタンを含むボタンを画面の下部に固定します。
最初は完全なXMLを投稿するべきではないと思っていました。これは通常、質問内に大量のコードが表示されることを拒否するためです。ただし、必要な場合があるため、ここに完全なレイアウトを示します。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="vertical"
    xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        android:id="@+id/video_layout"
        android:focusable="true"
        style="@style/VideoLayout">
        <FrameLayout
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:foreground="@android:drawable/ic_media_play"
            android:foregroundGravity="center">
            <ImageView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/video_thumb"
                android:padding="5dip"
                android:background="#454545"/>
        </FrameLayout>
        <TextView
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:focusable="true"
            style="@style/VideoTitle"
            android:id="@+id/video_title"
            android:layout_gravity="center"
            android:layout_weight="1"/>
    </LinearLayout>
    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_weight="1">
        <!-- this ScrollView expands the full height of the screen.
             However, the next LinearLayout does not expand the full height of the ScrollView -->
        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_weight="1"
            android:layout_gravity="fill"
            android:orientation="vertical"
            android:id="@+id/info_layout">
            <TextView
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:id="@+id/info_body"
                style="@style/InfoText"/>
            <LinearLayout
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                style="@android:style/ButtonBar">
                    <Button
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="center"
                        android:layout_weight="1"
                        android:text="@string/button_readmore"
                        android:id="@+id/btn_read_more"/>
            </LinearLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>
現時点ではandroid:layout_gravity="bottom"、問題のあるに頼ってLinearLayoutいます。これにより、ボタンが画面の下部に固定されます。しかし、それによってテキストが画面の下部に固定されてしまいます。
アップデート:、というスクラッチandroid:layout_gravity="bottom"作るScrollViewだけでなく、スクロール、できません。他のアイデア?
android:weight。