我有一个包含 6 个 FrameLayout
block 的 LinearLayout
。
有什么方法可以让父级 LinearLayout
中的所有 FrameLayout
block 居中?目前它们位于屏幕左侧而不是居中。
最佳答案
您可以在 LinearLayout 中使用 android:layout_gravity="center"
并在 FrameLayouts 中使用 android:gravity="center"
将它们设置在中心。还有其他选项see link
关于java - 在 LinearLayout 中居中多个 Framelayout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18629235/