でビューの重複を避けるために、私は次のようなレイアウトの構造を有する:どのようにRelativeLayout
<RelativeLayout>
<ScrollView>
<LinearLayout>
<RelativeLayout>
<LinearLayout android:id="@+id/ContentNo1"> <-- Align top
</LinearLayout>
<LinearLayout android:id="@+id/ContentNo2"> <-- Align bottom
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</ScrollView>
<Button/> <-- Always bottom of the page
</RelativeLayout>
マイボタンがFIRST RelativeLayoutにボトム整列され、そして私のScrollViewそれに上揃えを...
2番目のRelativeLayout内でContentNo1をTop-Alignし、ContentNo2をBone-Align ContentNo2にしたいと考えています。
私はこれを行いましたが、ContentNo1が大きすぎるとContentNo2が重なってしまいました。ダウン...それを行う方法?
...(この辺りでいくつかのトピックで説明するように)私は/ layout_aboveをlayout_below使用するように、試してみたが、私はそれを使用する場合、ContentNo2のボトムアライメントが却下される - EDITを -
Wasiには写真があり、ここで、尋ねたよう:(私は2つの以上のリンクを投稿することはできませんし、私はそれを説明するには、このページを作りました)
http://www.mydonorlife.hol.es/relativeissue/
- EDIT 2 - SOLUTION - これが私のために働いた
:私は2番目RelativeLayoutを取り出し、次のようないくつかのビュー>>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:layout_alignParentTop="true"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<!-- CONTENT NO 1 -->
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:layout_marginBottom="30dp">
</LinearLayout>
<!-- /CONTENT NO 1 -->
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_weight="1"
android:layout_height="0dp">
<!-- CONTENT NO 2 -->
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:gravity="bottom"
android:layout_height="match_parent"
android:layout_weight="0">
</LinearLayout>
<!-- /CONTENT NO 2 -->
</LinearLayout>
</LinearLayout>
</ScrollView>
<Button
android:layout_alignParentBottom="true"/>
</RelativeLayout>
がそれを願っています上のいくつかの重量/高さのトリックを設定しました後で誰かを助ける...
あなたはそれをフルスクリーンにするために、外側のLinearLayoutにマッチ親を使用して、layout_belowを使用することができます/ layout_above。次に、ボトムアライメントは消えません。 layout_below/layout_aboveを使用すると、2つの相対レイアウトが重複しないようにすることができます。 –
layout_below/aboveを使用すると、outer LinearLayoutは既にmatch_parentの高さで設定されており、bottom-alignmentは消えていきます。 –
bottom-alignmentが消えることは、content2が画面の残りの部分にフィットしないことを意味しますか?あなたは写真を共有できますか?イメージはこの問題のより良い説明を与えるかもしれません! –