zoukankan      html  css  js  c++  java
  • Android 微信样式的界面切换

     1     <RadioGroup
     2         android:id="@+id/main_tab_RadioGroup"
     3         android:layout_width="match_parent"
     4         android:layout_height="wrap_content"
     5         android:layout_gravity="bottom"
     6         android:background="@drawable/toolbar_bkg"
     7         android:gravity="center_vertical"
     8         android:orientation="horizontal" >
     9 
    10         <RadioButton
    11             android:id="@+id/model1"
    12             style="@style/tab"
    13             android:checked="true"
    14             android:drawableTop="@drawable/model1"
    15             android:text="@string/model1"/>"
    16 
    17         <RadioButton
    18             android:id="@+id/model2"
    19             style="@style/tab"
    20             android:drawableTop="@drawable/model2"
    21             android:text="@string/model2" />
    22 
    23         <RadioButton
    24             android:id="@+id/model3"
    25             style="@style/tab"
    26             android:drawableTop="@drawable/model3"
    27             android:text="@string/model3" />
    28     </RadioGroup>

    tab样式如下:

     1         <style name="tab">
     2         <item name="android:layout_width">match_parent</item>
     3         <item name="android:layout_height">match_parent</item>
     4         <item name="android:textSize">12dp</item>
     5         <item name="android:layout_weight">1.0</item>
     6         <item name="android:button">@null</item>
     7         <item name="android:layout_gravity">center_horizontal</item>
     8         <item name="android:gravity">center_horizontal</item>
     9         <item name="android:paddingTop">2dp</item>
    10         <item name="android:singleLine">true</item>
    11         <item name="android:textColor">@drawable/textcolor</item>
    12     </style>

    model1的样式如下:

    1 <?xml version="1.0" encoding="utf-8"?>
    2 <selector xmlns:android="http://schemas.android.com/apk/res/android" >
    3     <item android:state_checked="false" android:drawable="@drawable/tab_color_highlight"/>
    4     <item android:state_checked="true" android:drawable="@drawable/tab_color_normal"/>
    5 </selector>

    最终的样式如下:

  • 相关阅读:
    A good habit is half done
    mysql 练习题
    管理的实践
    mysql 表关联时执行顺序
    python 实现短信轰炸
    python django码云第三方登录
    mysql事务的隔离级别
    微服务
    什么是git
    如何使用Hexo创建博客
  • 原文地址:https://www.cnblogs.com/jjxxjnzy/p/4359064.html
Copyright © 2011-2022 走看看