3

次のジレンマがあります。2 つの要素が重なり合っています。底にwrap_contentは高さがあります。2 つの要素が重なることなく、一番上の要素で残りのスペースを埋める必要があります (これはFrameLayout、たとえば使用した場合に発生します)。

幅はmatch_parentすべての要素の幅です。

モックアップを次に示します (わかりやすくするために一部の属性を省略しています)。

<LinearLayout android:layout_height="match_parent">

  <CustomView android:layout_height="???????" /> 

  <TextView android:layout_height="wrap_content">

</LinearLayout>
4

1 に答える 1

9
<CustomView 
    android:layout_height="0dp"
    android:layout_weight="1"
    .../>
于 2012-10-15T13:16:20.073 に答える