Android实现微信底部的带消息提示数量
今天一朋友问我一个布局文件的实现,就是底部能带消息提示的TabHost的实现。其实这个效果之前早就想过,当初的想法就是肯定猜到了用FrameLayout来实现,那么今天就和大家分享这样的一个成果吧。而且像这种应用非常的广泛。好吧有图有真相,进入正题吧。
实现效果:
实现思想:
别奇怪也别惊讶,其实这还是一个TabActivity只不过是布局不一样而已,看到这个界面你会第一印象想到什么代表着你对布局是否熟练,很简 单,肯定是一个FrameLayout的层叠将那个消息的数字展现了出来。好吧,聪明如你,废话也不多说,其实上布局文件,你一看就明白了,呵呵。最后再 附上源代码吧:
<div class="dp-highlighter bg_html"><div class="bar"><div class="tools"><b>[html]</b> <a href="#" class="ViewSource" title="view plain" onclick="dp.sh.Toolbar.Command('ViewSource',this);return false;">view plain</a><a href="#" class="CopyToClipboard" title="copy" onclick="dp.sh.Toolbar.Command('CopyToClipboard',this);return false;">copy</a><a href="#" class="PrintSource" title="print" onclick="dp.sh.Toolbar.Command('PrintSource',this);return false;">print</a><a href="#" class="About" title="?" onclick="dp.sh.Toolbar.Command('About',this);return false;">?</a><div style="position: absolute; left: 0px; top: 0px; width: 0px; height: 0px; z-index: 99;"><embed id="ZeroClipboardMovie_2" src="http://static.blog.csdn.net/scripts/ZeroClipboard/ZeroClipboard.swf" loop="false" menu="false" quality="best" bgcolor="#ffffff" name="ZeroClipboardMovie_2" allowscriptaccess="always" allowfullscreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" flashvars="id=2&width=0&height=0" wmode="transparent" height="0" align="middle" width="0"></div></div></div><ol class="dp-xml" start="1"><li class="alt"><span><span class="tag"><?</span><span class="tag-name">xml</span><span> </span><span class="attribute">version</span><span>=</span><span class="attribute-value">"1.0"</span><span> </span><span class="attribute">encoding</span><span>=</span><span class="attribute-value">"utf-8"</span><span class="tag">?></span><span> </span></span></li><li class=""><span><span class="tag"><</span><span class="tag-name">TabHost</span><span> </span><span class="attribute">xmlns:android</span><span>=</span><span class="attribute-value">"http://schemas.android.com/apk/res/android"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@android:id/tabhost"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:orientation</span><span>=</span><span class="attribute-value">"vertical"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">FrameLayout</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@android:id/tabcontent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"0.0dip"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_weight</span><span>=</span><span class="attribute-value">"1.0"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">TabWidget</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@android:id/tabs"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_weight</span><span>=</span><span class="attribute-value">"0.0"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:visibility</span><span>=</span><span class="attribute-value">"gone"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_group"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_gravity</span><span>=</span><span class="attribute-value">"bottom"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@drawable/mmfooter_bg"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"bottom"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:orientation</span><span>=</span><span class="attribute-value">"horizontal"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:paddingTop</span><span>=</span><span class="attribute-value">"2.0dip"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">FrameLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"0.0dip"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_weight</span><span>=</span><span class="attribute-value">"1.0"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@null"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"bottom|center"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">RadioButton</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/tab_home"</span><span> </span></span></li><li class=""><span> <span class="attribute">style</span><span>=</span><span class="attribute-value">"@style/MMTabButton"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:checked</span><span>=</span><span class="attribute-value">"true"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:drawableTop</span><span>=</span><span class="attribute-value">"@drawable/tab_weixin"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"微信"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"top|right|center"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:paddingRight</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">TextView</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_unread_tv"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@drawable/tab_unread_bg"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"center"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"2"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:textColor</span><span>=</span><span class="attribute-value">"@android:color/white"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:textSize</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:visibility</span><span>=</span><span class="attribute-value">"visible"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">FrameLayout</span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">RadioButton</span><span> </span></span></li><li class=""><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/tab_second"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">style</span><span>=</span><span class="attribute-value">"@style/MMTabButton"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:drawableTop</span><span>=</span><span class="attribute-value">"@drawable/tab_address"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"通讯录"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">FrameLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"0.0dip"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_weight</span><span>=</span><span class="attribute-value">"1.0"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@null"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"bottom|center"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">RadioButton</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_find_friend"</span><span> </span></span></li><li class=""><span> <span class="attribute">style</span><span>=</span><span class="attribute-value">"@style/MMTabButton"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:drawableTop</span><span>=</span><span class="attribute-value">"@drawable/tab_find_frd"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"找朋友"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"top|right|center"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:paddingRight</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">TextView</span><span> </span></span></li><li class=""><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_new_tv"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@drawable/tab_unread_bg"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"center"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"2"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:textColor</span><span>=</span><span class="attribute-value">"@android:color/white"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:textSize</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:visibility</span><span>=</span><span class="attribute-value">"invisible"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">FrameLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">FrameLayout</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"0.0dip"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_weight</span><span>=</span><span class="attribute-value">"1.0"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@null"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"bottom|center"</span><span> </span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span> <span class="tag"><</span><span class="tag-name">RadioButton</span><span> </span></span></li><li class=""><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_settings"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">style</span><span>=</span><span class="attribute-value">"@style/MMTabButton"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:drawableTop</span><span>=</span><span class="attribute-value">"@drawable/tab_settings"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"设置"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">LinearLayout</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"fill_parent"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"top|right|center"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:paddingRight</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span><span class="tag">></span><span> </span></span></li><li class="alt"><span> </span></li><li class=""><span> <span class="tag"><</span><span class="tag-name">TextView</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:id</span><span>=</span><span class="attribute-value">"@+id/main_tab_setting_new_tv"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:layout_width</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:layout_height</span><span>=</span><span class="attribute-value">"wrap_content"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:background</span><span>=</span><span class="attribute-value">"@drawable/tab_unread_bg"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:gravity</span><span>=</span><span class="attribute-value">"center"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:paddingLeft</span><span>=</span><span class="attribute-value">"6.0dip"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:paddingRight</span><span>=</span><span class="attribute-value">"6.0dip"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:text</span><span>=</span><span class="attribute-value">"2"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:textColor</span><span>=</span><span class="attribute-value">"@android:color/white"</span><span> </span></span></li><li class=""><span> <span class="attribute">android:textSize</span><span>=</span><span class="attribute-value">"10.0dip"</span><span> </span></span></li><li class="alt"><span> <span class="attribute">android:visibility</span><span>=</span><span class="attribute-value">"invisible"</span><span> </span><span class="tag">/></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">FrameLayout</span><span class="tag">></span><span> </span></span></li><li class=""><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class="alt"><span> <span class="tag"></</span><span class="tag-name">LinearLayout</span><span class="tag">></span><span> </span></span></li><li class=""><span> </span></li><li class="alt"><span><span class="tag"></</span><span class="tag-name">TabHost</span><span class="tag">></span><span> </span></span></li></ol></div><pre style="display: none;" name="code" class="html"><?xml version="1.0" encoding="utf-8"?> <TabHost xmlns:android="http://schemas.android.com/apk/res/android" android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <FrameLayout android:id="@android:id/tabcontent" android:layout_width="fill_parent" android:layout_height="0.0dip" android:layout_weight="1.0" /> <TabWidget android:id="@android:id/tabs" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="0.0" android:visibility="gone" /> <LinearLayout android:id="@+id/main_tab_group" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_gravity="bottom" android:background="@drawable/mmfooter_bg" android:gravity="bottom" android:orientation="horizontal" android:paddingTop="2.0dip" > <FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:background="@null" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom|center" > <RadioButton android:id="@+id/tab_home" style="@style/MMTabButton" android:checked="true" android:drawableTop="@drawable/tab_weixin" android:text="微信" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top|right|center" android:paddingRight="10.0dip" > <TextView android:id="@+id/main_tab_unread_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/tab_unread_bg" android:gravity="center" android:text="2" android:textColor="@android:color/white" android:textSize="10.0dip" android:visibility="visible" /> </LinearLayout> </FrameLayout> <RadioButton android:id="@+id/tab_second" style="@style/MMTabButton" android:drawableTop="@drawable/tab_address" android:text="通讯录" /> <FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:background="@null" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom|center" > <RadioButton android:id="@+id/main_tab_find_friend" style="@style/MMTabButton" android:drawableTop="@drawable/tab_find_frd" android:text="找朋友" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top|right|center" android:paddingRight="10.0dip" > <TextView android:id="@+id/main_tab_new_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/tab_unread_bg" android:gravity="center" android:text="2" android:textColor="@android:color/white" android:textSize="10.0dip" android:visibility="invisible" /> </LinearLayout> </FrameLayout> <FrameLayout android:layout_width="0.0dip" android:layout_height="fill_parent" android:layout_weight="1.0" android:background="@null" > <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="bottom|center" > <RadioButton android:id="@+id/main_tab_settings" style="@style/MMTabButton" android:drawableTop="@drawable/tab_settings" android:text="设置" /> </LinearLayout> <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="top|right|center" android:paddingRight="10.0dip" > <TextView android:id="@+id/main_tab_setting_new_tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/tab_unread_bg" android:gravity="center" android:paddingLeft="6.0dip" android:paddingRight="6.0dip" android:text="2" android:textColor="@android:color/white" android:textSize="10.0dip" android:visibility="invisible" /> </LinearLayout> </FrameLayout> </LinearLayout> </LinearLayout> </TabHost></pre><br> <pre></pre> <p></p> <br> <p style="background:white">如需转载引用请注明出处:<a href="http://blog.csdn.net/jiahui524"><span style="color:#CA0000">http://blog.csdn.net/jiahui524</span></a></p> <p style="background:white">欢迎大家多多交流。分享为快乐之本!让我们菜鸟一起成长!</p> <p> </p> <p>源代码下载地址:<a href="http://download.csdn.net/detail/jiahui524/4218403">http://download.csdn.net/detail/jiahui524/4218403</a></p> <p><br> </p> <p> </p>