1、指定本元素的子元素相对它的对齐方式
android:gravity="top"
2、控件本身在父布局上的位置设置
android:layout_gravity="center"
layout_gravity好像只在LinearLayout有作用,且注意两点:
垂直(vertical)的LinearLayout布局内无法通过控件的Android:layout_gravity=""进行垂直居中,可以水平居中。
水平(horizontal)的LinearLayout布局内无法通过控件的android:layout_gravity=""进行水平居中,可以垂直居中。
3、更新控件颜色时对颜色的使用
tvAnswer1.setTextColor(getResources().getColor(R.color.primary)
4、layout_margin就是设置view的上下左右边框的额外空间
android:layout_marginTop="100dp" android:layout_marginBottom="100dp" android:layout_marginRight="100dp" android:layout_marginLeft="100dp"
5、android:padding是设置内容相对view的边框的距离
android:paddingBottom="20dp"
6、textView实现下划线效果方法之一:
<string name="url"><u>yuzhyun.me</u></string>
然后再在textView中使用这个String资源就行啦
。。。后续更新