网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。
一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!
android中的hint属性;
输入框 指定提示语
gravity 这个英文单词是重心的意思,在这里就表示停靠位置的意思。
android:gravity 是设置该view里面的内容相对于该view的位置,例如设置button里面的text相对于view的靠左,居中等位置。(也可以在Layout布局属性中添加,设置Layout中组件的位置)。
android:gravity只对该组件内的东西有效
Padding 为内边框,指该控件内部内容,如文本/图片距离该控件的边距
Margin 同级控件之间的距离,不是子控件边框与父控件边框的距离
如果左右上下都是相同的设置则可以直接设置
android:layout_margin="10dip"
android:padding="5dip"
安卓android:contentDescription
这时用户点击这个控件。android系统会自动使用人声朗读控件上android:contentDescription属性说指向的内容。
这样用户就可以知道这个控件是做什么用的。
这个属性的主要功能就是为视力有障碍的人增加对控件的解释。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout\_width="match\_parent"
android:layout\_height="match\_parent" >
<LinearLayout
android:id="@+id/regist\_username"
android:layout\_width="match\_parent"
android:layout\_height="wrap\_content"
android:layout\_centerHorizontal="true"
android:layout\_marginLeft="10dp"
android:layout\_marginRight="10dp"
android:layout\_marginTop="22dp"
android:orientation="horizontal">
<TextView
android:id="@+id/tv\_yonghu"
android:layout\_width="80dp"
android:layout\_height="wrap\_content"
android:gravity="right"
android:paddingRight="5dp"
android:text="用户名:"/>
<EditText
android:id="@+id/et\_usenames"
android:layout\_width="match\_parent"
android:layout\_height="wrap\_content"
android:hint="请输入你的用户名"
android:textSize="14dp"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/pass\_name"
android:layout\_width="match\_parent"
android:layout\_height="wrap\_content"
android:layout\_centerHorizontal="true"
android:layout\_below="@+id/regist\_username"
android:layout\_marginLeft="10dp"
android:layout\_marginRight="10dp"
android:layout\_marginTop="5dp"
android:orientation="horizontal"
>
<TextView
android:id="@+id/tv\_mima"
android:layout\_width="80dp"
android:layout\_height="wrap\_content"
android:gravity="right"
android:paddingRight="5dp"
android:text="密 码:"
/>
<EditText
android:id="@+id/et\_passmima"
android:layout\_width="match\_parent"
android:layout\_height="wrap\_content"
android:hint="请输入你的密码"
android:textSize="14dp"
/>
</LinearLayout>
<RadioGroup
![img](https://img-blog.csdnimg.cn/img_convert/c5701093d2b586898ef61f970683c68d.png)
![img](https://img-blog.csdnimg.cn/img_convert/fff9c6034c3df713f8f64f7fd8ff76cb.png)
**网上学习资料一大堆,但如果学到的知识不成体系,遇到问题时只是浅尝辄止,不再深入研究,那么很难做到真正的技术提升。**
**[需要这份系统化的资料的朋友,可以添加戳这里获取](https://bbs.csdn.net/topics/618668825)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**
5)**
**一个人可以走的很快,但一群人才能走的更远!不论你是正从事IT行业的老鸟或是对IT行业感兴趣的新人,都欢迎加入我们的的圈子(技术交流、学习资源、职场吐槽、大厂内推、面试辅导),让我们一起学习成长!**