LinearLayout、RelativeLayout、FrameLayout居中显示
来源:互联网 发布:攻壳模动队淘宝 编辑:程序博客网 时间:2024/05/16 06:01
LinearLayout、RelativeLayout、FrameLayout居中显示需要设置的属性不一样,今天总结下,方便以后使用~~
布局文件如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
/>
</LinearLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_gravity="center"
/>
</FrameLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_centerInParent="true"
/>
</RelativeLayout>
</LinearLayout>
LinearLayout、RelativeLayout、FrameLayout居中显示需要设置的属性不一样,今天总结下,方便以后使用~~
布局文件如下:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_horizontal"
android:orientation="vertical">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
/>
</LinearLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_gravity="center"
/>
</FrameLayout>
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content">
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/icon"
android:layout_centerInParent="true"
/>
</RelativeLayout>
</LinearLayout>
原文链接
0 0
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示
- LinearLayout、RelativeLayout、FrameLayout内容居中显示
- LinearLayout、RelativeLayout、FrameLayout居中显示整理
- android - LinearLayout、RelativeLayout、FrameLayout居中显示
- Android初学习 - LinearLayout、RelativeLayout、FrameLayout内容居中显示
- LinearLayout、FrameLayout、RelativeLayout 布局 内容居中
- Linearlayout RelativeLayout FrameLayout
- Android学习<LinearLayout, FrameLayout, RelativeLayout>
- LinearLayout, FrameLayout,RelativeLayout 布局案例
- Android 布局(LinearLayout\TableLayout\RelativeLayout\AbsoluteLayout\FrameLayout)
- 安卓 FrameLayout LinearLayout TableLayout RelativeLayout
- 【Android开发经验】关于dip、dpi和分辨率的一些事
- OpenGL超级宝典总结(二)2D/3D笛卡尔坐标、坐标裁剪、纹理坐标、MVP转换
- HDU 5044 Tree(树链剖分)
- BW:处理链报错解决步骤
- 笔试题一,计算机网络,操作系统
- LinearLayout、RelativeLayout、FrameLayout居中显示
- VSS2005的配置过程
- win7 下远程连接Linux里的hadoop 失败问题
- 关于AXURE RP的使用和用途
- POJ 3254(状态压缩DP)
- 基于mini2440开发板 Web服务器
- win7 激活方法
- UVA 11300-Spreading the Wealth(中位数)
- hdu 4866 主席树