android底部菜单栏的编写

android底部菜单栏的编写,第1张

概述 开发工具androidstdio,组件RadioButton 1.新建空项目DDDD 2.将事先准备好的图标复制到对应的文件夹中(如图),这五个文件夹都要拷进去,图标文件http://pan.baidu.com/s/1slVnev7 3.在values/colors.xml中加入几种会用到的颜色资源#3F51B5#303F9F#FF4081#f6f7f9#6E7174#4169E1#

  开发工具androID stdio,组件Radio button

  1.新建空项目dddd

  2.将事先准备好的图标复制到对应的文件夹中(如图),这五个文件夹都要拷进去,图标文件http://pan.baIDu.com/s/1slVnev7

  3.在values/colors.xml中加入几种会用到的颜色资源

#3F51B5#303F9F#FF4081#f6f7f9#6E7174#4169E1#E1E1E1

  4.在values/styles.xml中为Radiobutton编写统一样式

@color/colorPrimary@color/colorPrimaryDark@color/colorAccent" _ue_custom_node_="true">0dpmatch_parent1@nullcenter@drawable/top_menu6dp@color/main_menu_color" _ue_custom_node_="true">

  5.在res/drawable下新建几个Radiobutton对应的xml文件,将图片导入






 

6. 编写activity_main.xml文件,并将之前写好的样式和图片资源导入Radiobutton,界面部分就此完工,继续加功能的话,就要通过监听器实现活动间的跳转了。

 

<relativeLayout xmlns:androID="http://schemas.androID.com/apk/res/androID"xmlns:tools="http://schemas.androID.com/tools"    androID:ID="@+ID/activity_main"    androID:layout_wIDth="match_parent"    androID:layout_height="match_parent"    tools:context="test.example.com.dddd.MainActivity">    <linearLayout        androID:gravity="bottom"        androID:orIEntation="vertical"        androID:layout_wIDth="match_parent"        androID:layout_height="match_parent">        <RadioGroup            androID:orIEntation="horizontal"            androID:layout_wIDth="match_parent"            androID:layout_height="55dp">            <Radiobutton                                androID:drawabletop="@drawable/main_menu_location"                androID:checked="true"                androID:text="定位"                />            <Radiobutton                                androID:drawabletop="@drawable/main_menu_weather"                androID:text="天气" />            <Radiobutton                                androID:drawabletop="@drawable/main_menu_step"                androID:text="步数"                />            <Radiobutton                androID:text="好友"                androID:drawabletop="@drawable/main_menu_frIEnds"                />

  最终效果如图

 

总结

以上是内存溢出为你收集整理的android底部菜单栏的编写全部内容,希望文章能够帮你解决android底部菜单栏的编写所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/web/999493.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存