Android开发学习笔记(六)相对布局RelativeLayout
2023-09-14 09:01:38 时间
案例效果:
源码:
<RelativeLayout android:layout_height="wrap_content"
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="wrap_content"
>
<TextView
android:id="@+id/labe1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="相对布局"
android:textSize="50sp">
</TextView>
<EditText
android:id="@+id/et1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/labe1">
</EditText>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/et1"
android:text="OK"
android:layout_alignParentRight="true"
android:layout_marginRight="10dp"></Button>
</RelativeLayout>
两个值true对齐,false不对齐
相对某个控件layout_toLeftOfs (例子中没写)
总结:相对布局比较简单,主要注意每个控件取个id名即可
相关文章
- Android开发笔记(一百八十六)管理SQLite的利器——应用检查器App Inspection
- 加密狗android,Android系统加密狗的设计与实现
- Android系统启动流程 -- 学习笔记
- android开发笔记之 Android代码混淆打包
- android onresume方法,Android onActivityResult()和onResume()的执行顺序
- 测试android sdk是否安装成功,配置Android SDK
- android scaleanimation动画,Android 的ScaleAnimation 缩放动画基本运用
- Android studio学习笔记:adb被系统空闲进程占用了怎么办?
- android scaleanimation动画,Android 动画之ScaleAnimation应用详解「建议收藏」
- Android 数据库加密 android-database-sqlcipher 开源版本编译过程
- android两级分类列表且子列表item不同布局实现
- 【Android UI】贝塞尔曲线 ④ ( 使用 android.graphics.Path 提供的 cubicTo 方法绘制三阶贝塞尔曲线示例 )
- [android] 看博客学习Android常见的几种RuntimeException详解手机开发
- Android中的ProgressBar的android:indeterminate详解手机开发
- Android实现PHP连接MySQL进行数据交互(android通过php连接mysql)
- android版本检测Android程序的版本检测与更新实现介绍
- Android有道词典的简单实现方法介绍
- Android开发笔记之:深入理解Cursor相关的性能问题
- Android开发笔记之:在ImageView上绘制圆环的实现方法
- Android学习笔记-保存文件(SavingFiles)
- android照相、相册获取图片剪裁报错的解决方法
- Android学习笔记(二)App工程文件分析
- Android上使用ZXing识别条形码与二维码的方法