Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有四个文本视图,它们位于相同的线性布局上。当我在手机上运行我的应用程序时,它看起来还不错,但是当我在平板电脑上运行它时,它们就像显示在我的手机上一样。意思是不要t 扩展和使用提供的空白空间。你能告诉我如何实现这一目标吗?希望我很清楚。
android:layout_weight在定义 TextViews 时尝试使用。一个例子是android:layout_weight=".25"您的每个 TextViews,因此它们在 LinearLayout 中占用相等的空间。您可能还想android:gravity="center"在 LinearLayout 中使用,以便子项从中心显示。
android:layout_weight
android:layout_weight=".25"
android:gravity="center"
希望这就是你所追求的。