这个界面怎么实现 自己用RelativeLayout写一个,但是很乱,你们会怎么写androidrelativelayout 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 分成三块可以用linerlayout或RelativeLayout 分为三个layout左边一个Relative中间一个Relative右边的那个是用LinearLayout,并且设置this.setOrientation(VERTICAL);//一行只显示一个控件当然,直接全部都是用Relative绝对定位也不错。 一个LinearLayout,里面3个用RelativeLayout 简单的弄了下:<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:paddingLeft="10dp" android:paddingRight="10dp" android:paddingTop="10dp" > <ImageView android:layout_width="0dp" android:layout_height="100dp" android:layout_marginRight="10dp" android:layout_weight="1" android:background="@android:color/darker_gray" /> <LinearLayout android:layout_width="0dp" android:layout_height="100dp" android:layout_marginRight="10dp" android:layout_weight="1" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="0dp" android:layout_marginBottom="10dp" android:layout_weight="1" android:background="@android:color/holo_green_light" android:text="this is title" /> <TextView android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="4" android:background="@android:color/holo_orange_light" android:gravity="center" android:text="context" /> </LinearLayout> <LinearLayout android:layout_width="0dp" android:layout_height="100dp" android:layout_weight="1" android:orientation="vertical" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@android:color/holo_orange_light" android:text="TextView 0" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@android:color/holo_orange_light" android:text="TextView 1" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginBottom="10dp" android:background="@android:color/holo_orange_light" android:text="TextView 2" /> <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@android:color/holo_orange_light" android:text="TextView 3" /> </LinearLayout></LinearLayout> 关于android4.0系统默认屏幕方向的问题 问一个自定义ListView的问题 开发个类似微博或论坛的应用,怎么开发啊 这样的菜单效果怎么实现? 个人搞移动开发有没前途? 为什么listview能显示,但是加上onIntemlistener却没反映? 菜鸟学写安卓小程序,怎么在gprs下通过socket实现两个安卓程序之间的通信呢? 广播接受时 无法实例化 android中怎么将回车键变为确定按钮?各种输入法 小白求指教 videoView 播放 刷新界面? 怎样操作sqlite???????????????????????
可以用linerlayout或RelativeLayout
左边一个Relative
中间一个Relative
右边的那个是用LinearLayout,并且设置this.setOrientation(VERTICAL);//一行只显示一个控件当然,直接全部都是用Relative绝对定位也不错。
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:paddingTop="10dp" > <ImageView
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:background="@android:color/darker_gray" /> <LinearLayout
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_marginRight="10dp"
android:layout_weight="1"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_marginBottom="10dp"
android:layout_weight="1"
android:background="@android:color/holo_green_light"
android:text="this is title" /> <TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="4"
android:background="@android:color/holo_orange_light"
android:gravity="center"
android:text="context" />
</LinearLayout> <LinearLayout
android:layout_width="0dp"
android:layout_height="100dp"
android:layout_weight="1"
android:orientation="vertical" > <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@android:color/holo_orange_light"
android:text="TextView 0" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@android:color/holo_orange_light"
android:text="TextView 1" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:background="@android:color/holo_orange_light"
android:text="TextView 2" /> <TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/holo_orange_light"
android:text="TextView 3" />
</LinearLayout></LinearLayout>