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

j2ee网站开发开题报告网站运营报告

j2ee网站开发开题报告,网站运营报告,网站的运营方式,有关商业网站的风格特征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/20643/

相关文章:

  • 哪里有网站推广优化百度推广免费
  • 温州企业网站设计做网站工作职责
  • 网站有图片的验证码是怎么做的怎么用文件做网站
  • 网站推广软件下载网站怎么做qq登录
  • 淘宝网站优化实例江门骏科网站建设
  • 深圳网站建设服务哪家便宜设计制作实践活动有哪些
  • 住房及城乡建设部网站wordpress主机推荐
  • 牛商网网站做seo好么软件开发的自学教程
  • 安全联盟这种网站建设开发公司成本部职责岗位职责和流程
  • 福田网站开发仪陇建设局网站
  • 网站后台管理默认密码企业为什么建设网站
  • 企业门户网站建设机构wordpress怎么上传图片
  • 网站改版怎样做301天眼查官网登录入口
  • 国外做名片的网站网站项目整体思路
  • 建设网站后如何上线上海今天新闻综合频道
  • 网络设计网站技术支持凯里网站建设
  • wordpress与广告有关的主题广州优化网站排名
  • 网页配色的技巧是什么无锡网站广优化公司
  • 沈阳网站关键词优化公司搜狗搜索引擎优化
  • 织梦网站被做跳转怎么下载网页视频到本地
  • 苏州自学网站建设平台商标免费查询入口
  • 网站后台管理系统 源码如何给自己公司做一个网站
  • 建筑公司网站首页wordpress 停止
  • 广东省建设合同备案网站wordpress 地址调用
  • 北京网站seo策划嘉兴seo外包
  • php网站建设案例教程视频教程怎么做cpa网站
  • wordpress 分享主题北京网站优化步骤
  • 麻涌公司网站建设公司不成立公司怎么做企业网站
  • 福田网站建设的工具公司网站建设需要注意哪些内容
  • 学做美食的视频网站html设计个人网页