0
我设计了一个登录视图。我想要插入放置在父视图中心的片段布局。我硬编码输入一些片段布局来实现这个效果。但是,是否有更好的方法来做到这一点。如何在布局中包含空白视图
这是我的布局:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
</FrameLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="2"
android:orientation="horizontal">
<FrameLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1">
</FrameLayout>
<FrameLayout
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="2">
</FrameLayout>
<FrameLayout
android:id="@+id/login_frame"
android:layout_width="0px"
android:layout_height="match_parent"
android:layout_weight="1">
</FrameLayout>
</LinearLayout>
<FrameLayout
android:layout_width="match_parent"
android:layout_height="0px"
android:layout_weight="1">
</FrameLayout>
</LinearLayout>
谢谢你。
哇!我认为layout_marginTop非常有用=]。 – 2012-07-30 10:37:39