社区
Android
帖子详情
android按比例布局如何实现
zhongshansubor
2014-09-03 11:01:19
如下android布局如何实现:
具体要求:
1.左上区域会放android.support.v4.view.ViewPager控件用来放置图标,可以左右滑动翻页。
2.右上区域会会放置一列图标按钮。
3.下侧区域会放置一行图标按钮,可以左右翻动翻页,每个按钮点击对应左上区域的一页内容。
...全文
439
7
打赏
收藏
android按比例布局如何实现
如下android布局如何实现: 具体要求: 1.左上区域会放android.support.v4.view.ViewPager控件用来放置图标,可以左右滑动翻页。 2.右上区域会会放置一列图标按钮。 3.下侧区域会放置一行图标按钮,可以左右翻动翻页,每个按钮点击对应左上区域的一页内容。
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
7 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
passself
2014-09-03
打赏
举报
回复
两个linearlayout 就可以了,水平再垂直 layout_weight 分配比例,当然也可以用table
哎,真难
2014-09-03
打赏
举报
回复
layout_weight可以去研究下
zhongshansubor
2014-09-03
打赏
举报
回复
<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="vertical" android:weightSum="4" android:background="#ff0000" tools:context="com.example.viewpagertest.MainActivity$PlaceholderFragment" > <LinearLayout android:id="@+id/linearLayoutUp" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="3" android:background="#00ff00" android:orientation="horizontal" > <!-- 上左侧图标 --> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="6" > <android.support.v4.view.ViewPager android:id="@+id/viewPagerUpLeft" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> <!-- 上右侧按钮 --> <LinearLayout android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_weight="1" android:orientation="vertical" > <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/button_jysoft" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/button_jysoft" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/button_jysoft" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/button_jysoft" /> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="20dp" android:background="@drawable/button_jysoft" /> </LinearLayout> </LinearLayout> <!-- 下侧导航 --> <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:layout_weight="1" android:background="#0000ff" android:orientation="horizontal" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="sssss" /> <android.support.v4.view.ViewPager android:id="@+id/viewPagerBottom" android:layout_width="wrap_content" android:layout_height="wrap_content" /> </LinearLayout> </LinearLayout>
骑着蜗牛去爬山
2014-09-03
打赏
举报
回复
layout_weight
savior120
2014-09-03
打赏
举报
回复
请用linearlayout ,水平再垂直 layout_weight 值分配比例
fireyou
2014-09-03
打赏
举报
回复
layout_weight 调试一下
红袖满楼招
2014-09-03
打赏
举报
回复
layout_weight轻松实现啊
android
自定义
实现
比例
缩放的layout
一个小例子,用来解决屏幕的自适应问题。例子里是一个自定义
实现
比例
缩放的layout。
Android
按
比例
布局
如果要
实现
在LinearLayout里
实现
按
比例
布局
,一般采取的方式都是用weight来控制。 比如要
实现
几个控件分别按1:2:3的宽度来
布局
,父控件一般“layout_width”属性是“fill_parent”,关键是子控件的width和weight该...
android
高度
比例
布局
,
Android
中简单
实现
比例
布局
· Hiten’s Blog.
前些时候阅读过google的iosched项目,发现有个自定义
布局
类:AspectRatioFrameLayout,这个类的代码很简单,却很有用,就是
实现
一个高度跟宽度成
比例
的
布局
,我觉得在很多实际开发中,都会涉及到这个内容;...
android
重叠view 重叠
布局
,按
比例
布局
使用RelativeLayout即可
实现
重叠
布局
——RelativeLayout标签内容里面的下层
布局
会浮现在上层
布局
之上;上层
布局
会被下层
布局
覆盖
实现
layout: <RelativeLayout
android
:layout_width="match_parent" ...
android
图片按
比例
缩放,
Android
开发之imageView图片按
比例
缩放的
实现
方法
本文实例讲述了
Android
开发之imageView图片按
比例
缩放的
实现
方法。分享给大家供大家参考,具体如下:
android
:scaleType可控制图片的缩放方式,示例代码如下:
android
:src=\'#\'" /logo"
android
:scaleType=...
Android
80,351
社区成员
91,288
社区内容
发帖
与我相关
我的任务
Android
移动平台 Android
复制链接
扫一扫
分享
社区描述
移动平台 Android
android
android-studio
androidx
技术论坛(原bbs)
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章