Android Studio 布局属性笔记

Android Studio 线性布局属性LinearLayout
android:layout_width=(控件宽度)
android:layout_height=(控件高度)
(二者单位为dp,还可以使用match_parent匹配父空间)
android:id(控件的名称属性)
android:background=(控件背景)
android:orientation=(线性布局采用方向,水平horizontal或者垂直vertical)
android:padding=(控件内边距,还有paddingleft/right/top/bottom)
android:layout_margin=(控件外边距,还有marginleft/right/top/bottom)
android:gravity=(子控件在父控件的位置:居住或者怎么样)
android:layout_weight=“1”(未占用的父空间的占比权重,比如A控件有子控件B和C,A的宽度为100dp,B的宽度为20dp,C的宽度为10dp,B和C的占比权重都为1,则最终结果B占A的55dp宽度,C占45dp。)

android:id="@+id/信息显示"
android:layout_width=“wrap_content”
android:layout_height=“wrap_content”
android:text="@string/tv_test1"(引用strings.xml中的值)
android:textColor="#000000"
android:textSize=“24sp”
android:maxLines=“1”(设置文字最多行数)
android:ellipsize=“end”(字数显示不下用…显示)
/>

你可能感兴趣的:(Android,Studio)