loading请求处理中...
10大优享服务
62项会员特权

Android应用开发中微信下方四个按钮切换是如何实现的?

问题补充:是不是按钮使用Fragment,上方显示使用FragmeLayout,建立监听,然后每次改变Activity?监听需要重新写吗?
另外:那四个按钮是用什么做的?Button控件还是ActionBar?还是其他?
可以具体说说吗?谢谢!
提问者:效果图表现 4回答 浏览次数:1604 提问时间: 2021/12/01 12:02
提问者采纳

反编译了微信5.0 main_tab.xml的布局
<?xml version="1.0" encoding="utf-8"?>
  xmlns:android="
 
    < FrameLayout android:layout_width="fill_parent" android:layout_height="fill_parent">
       
            < FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" />
           
           
                < FrameLayout android:background="@null" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                   
                       
                   
                   
                       
                   
                < /FrameLayout>
                < FrameLayout android:background="@null" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                   
                       
                   
                   
                       
                   
                < /FrameLayout>
                < FrameLayout android:background="@null" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                   
                       
                   
                   
                       
                   
                   
                       
                   
                   
                       
                   
                < /FrameLayout>
                < FrameLayout android:background="@null" android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0">
                   
                       
                   
                   
                       
                   
                < /FrameLayout>
           
       
       
    < /FrameLayout>

 看到Tabhost+RadioButton的实现了吧。

全部回答

问题分类

我 要 回 答 我 要 提 问
问题分类   验证码 换一组