-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 >

相关问题