如何创建一个Android的标签般的​​UI? [英] How to create a Tab-like UI in Android?

查看:140
本文介绍了如何创建一个Android的标签般的​​UI?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想实现一个活动里面制表般的UI。这是我希望它是。结果
有3个,其中每个与一个LinearLayout中相关按钮。当用户点击一个按钮的当前可见布局淡出和与点击按钮相关联的一个淡入图。结果
如何才能做到这一点?特别是如何使衰落效应?

I'm trying to implement a Tab-like UI inside an activity. This is how I want it to be.
There are 3 button which each is associated with a LinearLayout. When the user clicks on a button the current visible layout fades out and the one associated with the clicked button fades into view.
How can this be done? Specially how to make the fading effect?

推荐答案

如果还是要手动,你可以做如下操作更好您标签控件去:

Better you go with tab widget if still you want to do manually you can do as follows:


  1. 制作一个相对布局(根)

  2. 创建财产宽度填充母高度包装内容一个线性布局,给怀特3

  3. 线性布局
  4. 将3个按钮与1 1weigth

  5. 取3相布局像按钮选项卡中的每确保这些3上面对齐/下面的按钮布局

  6. 在每个相对布局的每个按钮组vissibility的单击事件我完全填补üř需要

这篇关于如何创建一个Android的标签般的​​UI?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆