Android是什么:layout_alignLeft Android中? [英] What is android:layout_alignLeft in Android?
问题描述
我不能明白属性android:layout_alignLeft。我是新来的android开发
i couldnt understand the attribute android:layout_alignLeft .i am new to android development.
<RelativeLayout
android:id="@+id/r5"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/r4"
> <TextView
android:id="@+id/tv3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:layout_marginTop="10dp"
android:textSize="16sp"
android:textColor="#663300"
android:text="TextView"
/>
<TextView
android:id="@+id/tv5"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_alignLeft="@id/tv3"
android:textSize="16sp"
android:textColor="#663300"
android:text="TextView"
/>
<TextView
android:id="@+id/tv6"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/tv5"
android:layout_marginTop="10dp"
android:textSize="16sp"
android:textColor="#663300"
android:text="TextView"
/>
</RelativeLayout>
任何人都可以清楚地解释什么是机器人之间的区别:layout_Leftof和android:layout_alignLeft
anyone can explain clearly?what is the difference between android:layout_Leftof and android:layout_alignLeft?
推荐答案
layout_alignLeft
让您的视图的左边缘的ID,你作为使用视图的左边缘匹配参数
layout_alignLeft
makes the left edge of your view match the left edge of the view whose ID you use as the parameters.
layout_toLeftOf
使得放置在视图左侧的使用ID(右边缘将与另一种观点的左边缘对齐)。你的看法
layout_toLeftOf
makes your view placed to the left side of the view whose ID you use (the right edge will be aligned with the left edge of the other view).
这篇关于Android是什么:layout_alignLeft Android中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!