当前位置: 首页 > news >正文

微信开发网站设计wordpress商城安装教程

微信开发网站设计,wordpress商城安装教程,免费域名申请入口,网站建设费用怎么算TabWidget类似于通话记录的界面#xff0c;通过切换多个标签从而显示出多个不同内容#xff0c;能够展示内容丰富的页面信息#xff0c;而且彼此之间不会干扰#xff0c;有利于展示。下面#xff0c;通过一个例子来学习用法 首先用一个类来继承TabActivity 在开发之前通过切换多个标签从而显示出多个不同内容能够展示内容丰富的页面信息而且彼此之间不会干扰有利于展示。下面通过一个例子来学习用法 首先用一个类来继承TabActivity 在开发之前我们要首先了解TabHost是整个Tab的容器包括两部分TabWidget和FrameLayout。TabWidget就是每个tab的标签FrameLayout则是tab内容。接着我们开始初始化main.xml。 首先声明TabHost包含TabWidgetFrameLayout元素。 TabHost android:idandroid:id/tabhost //声明控件IDandroid:layout_widthfill_parent //控件宽度与父控件一致android:layout_heightfill_parent //控件高度与父控件一致 声明TabWidgettab标签页TabWidget android:layout_widthfill_parent //控件宽度与父控件一致android:layout_heightwrap_content //控件高度与自身适应android:idandroid:id/tabs //声明控件ID 声明FrameLayouttab页里的内容信息FrameLayout android:layout_widthfill_parent //控件宽度与父控件一致android:layout_heightwrap_content //控件高度与自身适应android:idandroid:id/tabcontent //声明控件ID 注意下 如果我们使用extends TabAcitivty如同ListActivityTabHost必须设置为android:id/tabhost TabWidget必须设置android:id为android:id/tabs FrameLayout需要设置android:id为android:id/tabcontent 布局文件 ?xml version1.0 encodingutf-8? TabHost xmlns:androidhttp://schemas.android.com/apk/res/androidandroid:layout_widthmatch_parentandroid:layout_heightmatch_parentandroid:idandroid:id/tabhost LinearLayoutandroid:layout_widthfill_parentandroid:layout_heightfill_parentandroid:orientationvertical FrameLayout android:idandroid:id/tabcontent android:layout_widthfill_parentandroid:layout_height0.0dipandroid:layout_weight1.0/TabWidget android:idandroid:id/tabs android:layout_widthfill_parentandroid:layout_heightwrap_contentandroid:visibilitygone/RadioGroupandroid:idid/tab_itemsandroid:gravitycenter_verticalandroid:layout_widthfill_parentandroid:layout_heightwrap_contentandroid:orientationhorizontalandroid:layout_gravitybottomandroid:backgrounddrawable/tab_bgRadioButtonandroid:idid/tab_item_homeandroid:checkedtrue stylestyle/main_tab_bottomandroid:backgrounddrawable/item_home_bg /RadioButtonandroid:idid/tab_item_nearby stylestyle/main_tab_bottomandroid:backgrounddrawable/item_near_bg/RadioButtonandroid:idid/tab_item_sort stylestyle/main_tab_bottomandroid:backgrounddrawable/item_sort_bg /RadioButtonandroid:idid/tab_item_mine stylestyle/main_tab_bottomandroid:backgrounddrawable/item_mine_bg/ RadioButtonandroid:idid/tab_item_more stylestyle/main_tab_bottom android:backgrounddrawable/item_more_bg //RadioGroup/LinearLayout/TabHost 其中有些控件的图片点击与正常情况下是不同的,如item_home_bg.xml文件 ?xml version1.0 encodingutf-8? selector xmlns:androidhttp://schemas.android.com/apk/res/android item android:state_checkedtrue android:drawabledrawable/but_index_r_v2 /item android:drawabledrawable/but_index_v2/ /selector style文件在values文件夹下的styles.xml文件中定义 ?xml version1.0 encodingutf-8? resourcesstyle namemain_tab_bottomitem nameandroid:gravitycenter_horizontal/itemitem nameandroid:layout_widthfill_parent/itemitem nameandroid:layout_heightwrap_content/itemitem nameandroid:buttonnull/itemitem nameandroid:layout_weight1.0/item/style/resources 函数实现 public class MyTab extends TabActivity{private final static String TAG TabShow;private TabHost mHost;private RadioGroup tabItems;private RadioButton mineBut;Overrideprotected void onCreate(Bundle savedInstanceState) {// TODO Auto-generated method stubsuper.onCreate(savedInstanceState);setContentView(R.layout.tablay);initResourceRefs();initSettings();}private void initSettings() {// TODO Auto-generated method stubtabItems.setOnCheckedChangeListener(new OnCheckedChangeListener() {Overridepublic void onCheckedChanged(RadioGroup group, int checkedId) {// TODO Auto-generated method stubswitch(checkedId){case R.id.tab_item_home :mHost.setCurrentTabByTag(HOME);break;case R.id.tab_item_nearby :mHost.setCurrentTabByTag(NEAR);break;case R.id.tab_item_sort :mHost.setCurrentTabByTag(SORT);break; case R.id.tab_item_more :mHost.setCurrentTabByTag(MORE);break;}}});}private void initResourceRefs() {// TODO Auto-generated method stubmHost getTabHost();mHost.addTab(mHost.newTabSpec(HOME).setIndicator(HOME).setContent(new Intent(this , HomeActivity.class)));mHost.addTab(mHost.newTabSpec(NEAR).setIndicator(NEAR).setContent(new Intent(this , NearByActivity.class)));mHost.addTab(mHost.newTabSpec(SORT).setIndicator(SORT).setContent(new Intent(this , SortActivity.class)));mHost.addTab(mHost.newTabSpec(My).setIndicator(My).setContent(new Intent(this , MyActivity.class)));mHost.addTab(mHost.newTabSpec(MORE).setIndicator(MORE).setContent(new Intent(this , MoreActivity.class)));tabItems (RadioGroup)findViewById(R.id.tab_items);mineBut (RadioButton)findViewById(R.id.tab_item_mine);}} 效果如下
http://www.zqtcl.cn/news/325754/

相关文章:

  • 网站建设基础考试php网站开发入门
  • 广州五屏网站建设seo诊断报告示例
  • 周浦高端网站建设公司信阳做网站的公司
  • 博客网站怎么建设湛江新闻头条最新消息
  • 外贸网站建设 评价有没有教做网站实例视频
  • 县 住房和城乡建设局网站wordpress接入支付宝
  • 网站建设初期推广方式天津网站建设案例
  • 销项税和进项导入是在国税网站做吗凡科网站模块
  • 苏州建网站皆去苏州聚尚网络常州企业建站系统
  • 网站建设明细wordpress 主题稳定
  • 网站设计论文前言怎么写肇庆网站开发哪家专业
  • 商城建站系统松江新城做网站公司
  • 长沙招聘做搜狗pc网站优化排
  • 辽宁智能建站系统价格金融做市场广告挂哪些网站
  • 做外贸的有哪些网站互动平台游戏
  • 网站设计最好的公司idc网站模板源码下载
  • 网站建设历史视频制作软件有哪些
  • 加盟网站制作定制桥的设计网站建设
  • 深圳做宣传网站的公司开发电商网站多少钱
  • 自适应网站建设公司什么是网站死链
  • 自己给网站做支付接口wordpress elementor
  • 中国最新军事新闻网站优化推广
  • 有没有做3d衣服模型网站php网站开发目的
  • 东莞网站建设方案咨询wordpress易企秀
  • 漳诈网站建设免费的企业网站建设
  • 广州番禺区有什么好玩的地方优化软件有哪些
  • 面包机做面包网站wordpress获取用户注册时间
  • 福州网站建设个人兼职泰州seo排名扣费
  • 泰安北京网站建设公司个人自我介绍网页
  • 网站建设适应全屏如何自动深圳市哪里最繁华