有一个布局如下所示:从中间向两边排列。
有什么样的布局可以使用?或者那种view的属性可以这样设置
解决方案 »
- 求助,Activities can't be added until the containing group has been created
- 4.0Brower中下载时报android.process.media错
- 关于Android设置铃声的问题
- LuaState L = LuaStateFactory.newLuaState();
- 请问这个是什么意思
- 关于android的HTTPs的问题,有的手机就不会报错,有的手机就会有这些问题,没思路。。。
- android与PCsocket通信
- Android 手机游戏 赛车类地图的设计与实现的问题
- [跪求]android源代码
- Android MediaScanner扫描问题
- View缩放后上面绘制的坐标点的新坐标怎么计算?
- android webView 播放视频,面板中的下载按钮如何去除。
android:orientation="horizontal"
就可以了,下面是我实现的代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.example.zth.eight.EightActivity"
android:orientation="vertical"> <LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp"> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </LinearLayout> <LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp"> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout> <LinearLayout
android:gravity="center"
android:orientation="horizontal"
android:layout_width="match_parent"
android:layout_height="100dp"> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> <ImageView
android:src="@mipmap/ic_launcher"
android:layout_width="wrap_content"
android:layout_height="wrap_content" /> </LinearLayout></LinearLayout>
不过,可以在那个基础上改进一下,用代码动态添加。
或者,用tableLayout试试,方法肯定不止一个。
RelativeLayout
RelativeLayout
RelativeLayout
RelativeLayout
RelativeLayout
每个都垂直居中,万能的哈