【android】:TableLayout的用法
2016-05-26 23:25
429 查看
前言
正常的xml的用法,然后就是一个标签代表着一行一行里面可以写多个控件,其中
android:stretchColumns = “n” 这个属性代表着第n+1列会匹配剩余空间
一个实例为证:
xml文件为:
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:stretchColumns = "1" > <TableRow> <TextView android:layout_height ="wrap_content" android:text="Account:"/> <EditText android:id="@+id/account" android:layout_height="wrap_content" android:hint = "Input your account" /> </TableRow> <TableRow> <TextView android:layout_height ="wrap_content" android:text="Password:"/> <EditText android:id="@+id/password" android:layout_height="wrap_content" android:inputType = "textPassword" /> </TableRow> <TableRow> <Button android:id="@+id/login" android:layout_height="wrap_content" android:layout_span ="2" android:text = "Login"/> </TableRow> </TableLayout>
实例图:(明天传)
相关文章推荐
- 在Android Studio进行测试
- android方面文章收藏
- android的工具类
- 完整Android项目搭建全过程
- Android Retrofit 2.0框架上传图片解决方案(一张与多张的处理)
- 【android】:method(Bundle) onCreate is undefined
- Android 实现简单媒体播放器功能
- Android AIDL图解
- Android学习笔记(五七):使用Google Map API v2
- MaterialDesign+MovePicImageView实现漂亮的登陆界面
- Android正向传值和回调传值
- Android_Activity生命周期
- Android内存泄漏
- Android - Fragment
- Xamarin 从原生Android SDK创建Xamarin版本的C# SDK Bindings Library
- Android 学习资料收集
- Android - Activity
- Android开发步步为营之55:google广告平台admob接入总结
- Android原生Json解析
- Android开发中Activity的启动模式