TextViewを上に、ListViewを下に、TextViewを下に、どのように最後のTextViewを画面の下部に固定するか、ListViewを上部のtextViewと下部のTextViewの間に塗りつぶし、リストを持たない最後のTextViewを画面外に押しますか?listviewをテキストを押し下げるのを防ぐには?
0
A
答えて
3
(私が使用していたように)下に全体の相対的なレイアウトを取る
<RelativeLayout>
<LinearLayout>
<!-- All your other elements in here -->
</LinearLayout>
<TextView
android:layout_alignParentBottom="true" />
</RelativeLayout>
第二に、私は何をすべきかです。 (この例に続いて、もちろん、あなたのListViewでScrollViewを置き換えると思います。)
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="My Header Text" />
<ScrollView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all. Lots of content that needs to be scrolled, to see it all." />
</ScrollView>
<TextView
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:text="My Footer Text" />
</LinearLayout>
そして、ここではそれが私のG2のようになります。
1
リストビューを保持する線形レイアウトをネストします。
1
リストビューではandroid:layout_weight="1"
、下部のTextViewではandroid:layout_weight="0"
が必要です。私はあなたの欲しいものに似たようなことを行います。
編集:実際には、ボトムのTextViewにネストされたLinearLayout android:layout_weight="0"
を置く必要があります。私はLLで囲まれたボトムバーを持っていますが、あなたのTextViewでlayout_weightを直接使用することができます
1
これは2通りの方法で実行できます。 まず、
LinearLayoutからTextViewを取り出し、LinearLayoutとTextViewをRelativeLayout内で結合します。 android:layout_alignParentBottom = "true"をTextViewに追加します。ここで
<RelativeLayout
android:id="@+id/InnerRelativeLayout"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true">
<Button
android:text="@string/label_submit_button"
android:id="@+id/Button"
android:layout_alignParentRight="true"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<EditText
android:id="@+id/EditText"
android:layout_width="fill_parent"
android:layout_toLeftOf="@id/Button"
android:layout_height="wrap_content" />
</RelativeLayout>
関連する問題
- 1. JQuery:古いものを押し下げてテキストを変更する
- 2. コンテンツページを押し下げるのを防ぐために、どのようにnav divにツリービューコントロールを配置しますか?
- 3. コンテンツエリアの拡大中に他の要素を押し下げる
- 4. ボタンの後にコンテナを押し下げるCSS
- 5. jQueryスライダダウンが絶対位置なしにページを押し下げるのを防ぎます
- 6. 身体と背景を普遍的に押し下げる
- 7. 入力テキストに「ポストアクセント」を防ぐ方法
- 8. knitr:出力のテキスト折り返しを防ぐには?
- 9. 閉じるメニューからEnterを押すのを防ぐ方法
- 10. 他のグリッド要素を押し下げた縦の列//ブートストラップ3
- 11. onDestroyがスクリーンオフボタンが押されているのを防ぐ
- 12. ガベージコレクタによるアプリケーションの速度低下を防ぐ方法
- 13. ngDialogが上下にスクロールするのを防ぐ方法
- 14. コンテンツDIVがフッタを押し下げていない
- 15. 重複するアイテムを防ぐ方法listView C#
- 16. インラインブロックのミスアライメント(他の要素が押し下げられる)
- 17. ユーザーが通知を却下するのを防ぐ
- 18. 崇高なテキスト2 - ._ファイルを作成するのを防ぐ
- 19. ブートストラップ3 |列の内容は他の列を押し下げます
- 20. Java:キー押下時のビープ音を防止する
- 21. 入力で入力を押したときにWebKitブラウザがフォームを送信するのを防ぐには
- 22. フッタを押し下げるためにjqueryを使ってタブの高さを計算するには
- 23. デッドロックを防ぐ
- 24. を防ぐページスクロール
- 25. ユーザーがBackを押すとブラウザがページをリロードするのを防ぐ
- 26. iphoneのuitextviewの段落(字下げ)としてテキストを印刷
- 27. 相対的なdiv内の絶対オーバーフローdivを押し下げる
- 28. テキストが重複するのを防ぐtable td width
- 29. アンドロイドキーボードが画面を押し上げる
- 30. IE9でサブナビゲーションを押し上げる