1
固定フッターを持つAndroidレイアウトを作成しようとしていますが、残りの領域はScollViewで占めています。 ScrollViewの一番下に固定されていて、ScrollViewの背後に固定されている(そして内容がスクロールされている)2番目の「フッター」が必要です。 )visual exampleです。2番目の固定フッターをScrollViewの下にレイアウトするにはどうすればよいですか?
私はRelativeLayout methodを使って固定フッターを作成しても機能しますが、それが占めるスペースは画面全体のサイズから削除されていないようです。私は一見無限の方法の組み合わせのように見えるものを試しました。そして、私は働くものを考え出すことができません。
ここでは私が取り組んできたことがあります。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="top" android:layout_height="fill_parent" android:layout_width="fill_parent" android:background="@drawable/background_image" android:orientation="vertical">
<ScrollView android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="fill" android:layout_weight="1">
<FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:layout_weight="1">
<ImageView android:layout_centerHorizontal="true" android:layout_width="fill_parent" android:layout_height="wrap_content" android:src="@drawable/scroll_footer_image" android:layout_gravity="bottom" android:layout_weight="1"></ImageView>
<LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="vertical" android:layout_weight="1">
<!-- content for the scrollview goes here. -->
</LinearLayout>
</FrameLayout>
</ScrollView>
<RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/footer_background_image" android:layout_alignParentBottom="true">
<ImageView android:scaleType="centerInside" android:layout_gravity="center" android:clickable="false" android:src="@drawable/footer_contents" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_centerInParent="true" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:layout_weight="0"></ImageView>
</RelativeLayout>
</LinearLayout>
私は1つの可能な解決策を思いついてきました。私が取り組んでいる固定フッターはイメージに基づいているので、スクロールフッターに空のスペースを追加しました。スクロールフッターイメージとその中のスクロールビューを持つFrameLayoutと、固定フッターのための別々のLinearLayoutがすべてRelativeLayoutにラップされています。私はそのような画像を操作する大きなファンではないので、そこに他のソリューションがあるかどうかを確認することはまだ興味があります。 – Mark
ああ、その解決策はFrameLayoutを離れて、固定フッターの後ろに座っているScrollViewが読めないコンテンツを残してしまいます。 – Mark