2016-05-01 7 views
1

私はRelativeLayoutのAndroidアプリケーションにマルチラインEditTextを持っています。それ自体はGridLayoutの子で、2列あります。各RelativeLayoutには1のcolumnWeightがあり、その結果2つのEditTextが画面の半分を占めます。各レイアウトの幅は、重みが優先されるように0dpに設定されます。RelativeLayoutのAndroid EditTextがあまりにも速く広がっています

RelativeLayoutの高さは、wrap_contentに設定され、EditTexts自体の高さも同じです。私はRelativeLayoutの高さがEditTextで直線的に拡大すると期待していますが、それはそうではないようです。代わりに、8文字の英字がRelativeLayoutの高さをほぼ4倍にするように、1行の高さをおよそ1文字おきにレイアウトします。私の腸はそれが重み付け/幅と関係があると私に言っていますが、私はそれを確認するために何かオンラインで見つけることができません。なぜこうなった?

<GridLayout 
    android:id="@+id/proficiencyGrid" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@+id/featuresWrapper" 
    android:layout_centerHorizontal="true" 
    android:columnCount="2" 
    android:orientation="horizontal" 
    android:rowCount="6" > 

....

<RelativeLayout 
    android:id="@+id/personalityWrapper" 
    android:layout_width="0dp" 
    android:layout_height="wrap_content" 
    android:layout_column="0" 
    android:layout_columnWeight="1" 
    android:layout_gravity="fill" 
    android:layout_row="4" > 

....

<EditText 
    android:id="@+id/personalityDialog" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:layout_below="@id/personalitySeparator" 
    android:inputType="textMultiLine" 
    android:padding="15dp" 
    android:textColor="@android:color/white" 
    android:textSize="16sp" > 

Height Expand EditText Issue

答えて

0

私は水平LinearLayoutsを使用してのではなく置くことを試みることによって私のレイアウトの問題を修正するために管理それらはすべてGridLayoutにあります。私のRelativeLayoutsがなぜそれほど速い速度で拡大していたのかという疑問に答えることはできませんが、代わりの方法があります。重み付けはGridLayoutsの比較的新しいものですから、重み付けを行うためにレイアウトの幅を0dpとする必要があると確信していますが、誰もこれを確認していません。

関連する問題