andrid底部导航栏设计说明Word格式.docx
- 文档编号:19262233
- 上传时间:2023-01-04
- 格式:DOCX
- 页数:8
- 大小:59.72KB
andrid底部导航栏设计说明Word格式.docx
《andrid底部导航栏设计说明Word格式.docx》由会员分享,可在线阅读,更多相关《andrid底部导航栏设计说明Word格式.docx(8页珍藏版)》请在冰豆网上搜索。
android="
http:
//schemas.android./apk/res/android"
<
LinearLayoutandroid:
orientation="
vertical"
FrameLayoutandroid:
id/tabcontent"
0.0dip"
layout_weight="
/>
TabWidgetandroid:
id/tabs"
visibility="
gone"
wrap_content"
0.0"
RadioGroup
gravity="
center_vertical"
layout_gravity="
bottom"
horizontal"
@id/main_radio"
background="
@drawable/maintab_toolbar_bg"
RadioButton
@id/radio_button0"
layout_marginTop="
2.0dip"
text="
@string/main_home"
drawableTop="
@drawable/icon_1_n"
style="
@style/main_tab_bottom"
@id/radio_button1"
@string/main_news"
@drawable/icon_2_n"
@id/radio_button2"
@string/main_manage_date"
@drawable/icon_3_n"
@id/radio_button3"
@string/main_friends"
@drawable/icon_4_n"
@id/radio_button4"
@string/more"
@drawable/icon_5_n"
/RadioGroup>
/LinearLayout>
/TabHost>
[2]res/drawable下的home_btn_bg.xml源码:
.2cto.
selector
itemandroid:
state_focused="
true"
state_enabled="
state_pressed="
false"
drawable="
@drawable/home_btn_bg_s"
state_checked="
@drawable/home_btn_bg_d"
@drawable/transparent"
/selector>
[3]res/values下的源码:
dimens.xml源码
utf-8"
resources>
dimenname="
bottom_tab_font_size"
10.0sp<
/dimen>
bottom_tab_padding_up"
5.0dip<
bottom_tab_padding_drawable"
2.0dip<
switch_logo_bottom_padding"
30.0sp<
widget_height"
100.0dip<
sta_height"
48.0dip<
large_padding_length"
20.0dip<
widget_write_margin_top"
19.0dip<
widget_write_margin_left"
10.0dip<
widget_content_margin_top"
widget_content_margin_left"
widget_logo_size"
35.0dip<
title_height"
74.0dip<
new_blog_size"
70.0dip<
emotion_item_view_height"
13.299988dip<
splash_test_top_margin_top"
splash_test_center_margin_right"
0.0dip<
title_text_size"
20.0sp<
normal_padding_length"
no_result_padding_length"
50.0dip<
/resources>
drawables.xml源码:
itemtype="
drawable"
name="
ltgray"
#fff4f4f4<
/item>
ltyellow"
#fffff4db<
black"
#ff000000<
transparent"
#00000000<
widget_edit_block_bg_normal"
color/transparent<
transparent_background"
#99000000<
list_background"
namcard_picker_bkg_normal"
#ff272727<
namcard_picker_bkg_hover"
#ff333333<
ids.xml源码:
id"
main_radio"
false<
radio_button0"
radio_button1"
radio_button2"
radio_button3"
radio_button4"
strings.xml源码:
stringname="
hello"
HelloWorld,MainTabActivity!
/string>
app_name"
TabDemo<
main_news"
消息<
main_home"
首页<
more"
更多<
main_manage_date"
时间<
main_friends"
好友<
styles.xml源码:
stylename="
main_tab_bottom"
itemname="
android:
textSize"
@dimen/bottom_tab_font_size<
textColor"
#ffffffff<
ellipsize"
marquee<
gravity"
center_horizontal<
background"
@drawable/home_btn_bg<
paddingTop"
@dimen/bottom_tab_padding_up<
paddingBottom"
layout_width"
fill_parent<
layout_height"
wrap_content<
layout_marginBottom"
button"
@null<
singleLine"
true<
drawablePadding"
@dimen/bottom_tab_padding_drawable<
layout_weight"
1.0<
/style>
[4]src/.andyidea.tabdemo包下面各个UI界面类源码:
MainTabActivity.java源码:
package.andyidea.tabdemo;
importandroid.app.TabActivity;
importandroid.content.Intent;
importandroid.os.Bundle;
importandroid.view.Window;
importandroid.widget.CompoundButton;
importandroid.widget.RadioButton;
importandroid.widget.CompoundButton.OnCheckedChangeListener;
importandroid.widget.TabHost;
publicclassMainTabActivityextendsTabActivityimplementsOnCheckedChangeListener{
privateTabHostmTabHost;
privateIntentmAIntent;
privateIntentmBIntent;
privateIntentmCIntent;
privateIntentmDIntent;
privateIntentmEIntent;
/**Calledwhentheactivityisfirstcreated.*/
@Override
publicvoidonCreate(BundlesavedInstanceState){
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.maintabs);
this.mAIntent=newIntent(this,AActivity.class);
this.mBIntent=newIntent(this,BActivity.class);
this.mCIntent=newIntent(this,CActivity.class);
this.mDIntent=newIntent(this,DActivity.class);
this.mEIntent=newIntent(this,EActivity.class);
((RadioButton)findViewById(R.id.radio_button0))
.setOnCheckedChangeListener(this);
((RadioButton)findViewById(R.id.radio_button1))
((RadioButton)findViewById(R.id.radio_button2))
((RadioButton)findViewById(R.id.radio_button3))
((RadioButton)findViewById(R.id.radio_button4))
setupIntent();
}
publicvoidonCheckedChanged(CompoundButtonbuttonView,booleanisChecked){
if(isChecked){
switch(buttonView.getId()){
caseR.id.radio_button0:
this.mTabHost.setCurrentTabByTag("
A_TAB"
);
break;
caseR.id.radio_button1:
B_TAB"
caseR.id.radio_button2:
C_TAB"
caseR.id.radio_button3:
D_TAB"
caseR.id.radio_button4:
MORE_TAB"
privatevoidsetupIntent(){
this.mTabHost=getTabHost();
TabHostlocalTabHost=this.mTabHost;
localTabHost.addTab(buildTabSpec("
R.string.main_home,
R.drawable.icon_1_n,this.mAIntent));
R.string.main_news,
R.drawable.ic
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- andrid 底部 导航 设计 说明