我有一個簡單GridLayout
:的Android GridLayout的fill_horizontal熄滅屏幕
<GridLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:columnCount="2"
android:rowCount="1" >
<TextView
android:layout_column="0"
android:layout_row="0"
android:text="Label"/>
<EditText
android:inputType="text"
android:layout_column="1"
android:layout_row="0"
android:text="asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf asdf"
android:layout_gravity="fill_horizontal"/>
</GridLayout>
然而,這將導致EditText
延長關閉屏幕,如下面(圖像從所述IDE中可以看出,但它同樣的時在設備上運行)。
看來,EditText
實際上是在屏幕的整個寬度,而不是GridLayout
細胞,這就是爲什麼它會關閉屏幕的寬度。造成這種情況的佈局出了什麼問題?
http://stackoverflow.com/questions/30845440/edittext-getting-out-of-gridlayout看到這個 – KrishnaJ