Android开发UI布局必备基础知识
来源:互联网 发布:linux enca 编辑:程序博客网 时间:2024/06/05 04:45
作为一个安卓工程师,你一定少不了一些开发技巧,我总结了一些XML文件的简单布局技巧,看看吧!
android:imeOptions="actionDone"将EditText的imeOptions属性设置android:imeOptions=”actionDone”,则不管是不是最后一个EditText,点击回车键即隐藏输入法。
android:layout_marginLeft="10px" margin:边距。
该组件距离左边组件10像素。其他类似的还有
android:layout_marginLeft,意思是距离左边框的距离;
android:layout_marginRight,意思是距离右边框的距离。
android:layout_marginTop: 距离上边框
android:layout_marginBottom: 距离下边框
android:gravity:这个是针对控件里的元素来说的,用来控制元素在该控件里的显示位置。例如,在一个Button按钮控件中设置如下两个属性,
android:gravity="left"和android:text="提交",这时Button上的文字“提交”将会位于Button的左部。
android:layout_gravity:这个是针对控件本身而言,用来控制该控件在包含该控件的父控件中的位置。同样,当我们在Button按钮控件中设置android:layout_gravity="left"属性时,表示该Button按钮将位于界面的左部。
android:layout_weight="1.8":就是分配地方的比重。
注意:按比例显示LinearLayout内各个子控件,需设置android:layout_width="0dp",如果为竖直方向的设 置android:layout_height="0dp"。在这种情况下某子个控件占用LinearLayout的比例为:本控件weight值 / LinearLayout内所有控件的weight值的和。
更多文章请关注个人微博:@Lx_Rosen
- Android开发UI布局必备基础知识
- QML入门必备基础知识之——UI布局管理
- Android开发-UI布局
- Android内核开发必备的基础知识
- Android 游戏开发必备的基础知识
- Android UI 开发入门—线性布局
- Android-UI开发之常用布局
- iOS应用开发----必备基础知识
- iOS应用开发----必备基础知识
- Web开发必备HTTP基础知识
- android常用的必备基础知识
- Android开发基础知识整理之UI与Fragment
- android相对布局基础知识
- android UI设计,android ui开发,android 页面设计,android页面布局
- android开发基础知识(3) ---五大布局
- android ui布局观
- android布局--UI
- android UI布局
- rails 使用cancancan的一些心得
- iOS自定义相机截取图片旋转90°的问题
- Linux shell命令2
- javascript数组去重 - 效率测试
- check how many files are added or modified or deleted by git command and python
- Android开发UI布局必备基础知识
- 安装rebar时提示"Uncaught error in rebar_core"
- CocosCreator反射在Android中的使用
- linux内核学习的屠龙刀、倚天剑(需要搭配硬件调试环境)
- CheckBox复选框
- SlidingPaneLayout和DrawerLayout的区别
- 增量排序(未)
- IO密集型vs计算密集型
- Android Genymotion模拟器连接不上10.0.2.2:8080的解决办法