Android 安卓布局设计
我是android开发新手,我想在android中制作一个屏幕,如下所示: 有谁能帮我做到这一点: ImageView从左、右和顶部留出20px的空间。 空间 文本视图。 空间 文本视图1。 空间 TextView2:TextView3。 空间 。 . 如果不存在imageView,则应显示文本视图并隐藏imageView。示例:Android 安卓布局设计,android,android-layout,Android,Android Layout,我是android开发新手,我想在android中制作一个屏幕,如下所示: 有谁能帮我做到这一点: ImageView从左、右和顶部留出20px的空间。 空间 文本视图。 空间 文本视图1。 空间 TextView2:TextView3。 空间 。 . 如果不存在imageView,则应显示文本视图并隐藏imageView。示例: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/ll"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginLeft="20dip"
android:layout_marginRight="20dip"
android:layout_marginTop="20dip"
android:src="@drawable/img"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:layout_marginTop="5dip"
android:text="Txt1"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:layout_marginTop="5dip"
android:text="Txt2"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dip"
android:layout_marginLeft="2dip"
android:layout_marginRight="2dip"
android:layout_marginTop="5dip"
android:text="Txt3"/>
</LinearLayout>
带方向的线性布局:垂直如何从顶部和左侧留出空间您可以使用边距