-1

它不一定需要調整子視圖的大小,它只適合屏幕,不會隱藏佈局中的某些視圖,也不會在屏幕上留下醜陋的空間。如何使佈局調整大小/更改位置的所有子視圖使我的TableLayout填滿屏幕?

fragment_timetable.xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    tools:context=".timetable.TimetableFragment"> 

    <include layout="@layout/fragment_timetable_login" /> 

    <include layout="@layout/fragment_timetable_table" /> 
</LinearLayout> 

fragment_timetable_table.xml(Github的鏈接,因爲超出字數限制): https://github.com/gogobebe2/TheDayAhead/blob/master/app/src/main/res/layout/fragment_timetable_table.xml

這裏是所有的代碼(可能不相關) :https://github.com/gogobebe2/TheDayAhead

正如你可以看到,字體大小和TableLayout所有其他孩子的意見太大,適合在屏幕上: As you can see, the font size and all other child views in the <code>TableLayout</code> are too big to fit on the screen

如果屏幕再大,它太小,不填充屏幕: And if the screen is bigger, it's too small and doesn't fill the screen

+0

如果您不滿意我的問題,請解釋爲什麼或給我如何改進它的建議。 – gogobebe2

回答

0

我想通了。我需要做的只是將android:weightSum="11"添加到<TableLayout >並將android:layout_weight="1"添加到每個<TableRow >

相關問題