Android 在tablet视图中创建活动中心的xml布局,并将边框包围
如何为中心活动创建xml布局,并在tablet视图中包围边框,如此处链接的图片:(以红色指定) 我想把我的活动放在中间,两边各放两列Android 在tablet视图中创建活动中心的xml布局,并将边框包围,android,Android,如何为中心活动创建xml布局,并在tablet视图中包围边框,如此处链接的图片:(以红色指定) 我想把我的活动放在中间,两边各放两列 是否有创建此布局的标准方法 像这样创建布局 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
是否有创建此布局的标准方法 像这样创建布局
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#f5f5f5" >
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#000000" />
<!-- Activity layout -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="2" >
</LinearLayout>
<View
android:layout_width="2dp"
android:layout_height="match_parent"
android:background="#000000" />
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#f5f5f5" >
</LinearLayout>
</LinearLayout>
只需替换背景中的颜色代码即可获得所需的显示。您好,如何将阴影添加到边框?请检查此答案以将阴影添加到边框。