2010.12.28(4)——— android tab 过多的问题

网上大多都是用Gallery来模拟TabHost 但是自己实在是懒 就没这么做 一种可以凑合着用的简单做法:

只需要吧layout改一下即可


<?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"        android:background="#001629">        <HorizontalScrollView          android:layout_width="fill_parent"       android:layout_height="wrap_content">          <TabWidget android:id="@android:id/tabs"            android:layout_width="fill_parent"            android:layout_height="wrap_content"/>           </HorizontalScrollView>             <FrameLayout android:id="@android:id/tabcontent"            android:layout_width="fill_parent"            android:layout_height="wrap_content"            android:paddingTop="95px">         </FrameLayout></TabHost>



如上 在TabWidget外面加上HorizontalScrollView即可


不过 这样有个问题 宽度貌似改不了了 即使你只有一个tab 它并不会fill_parent 还是原来的宽度

但是 如果很多tab的话 还是好使的

更多相关文章

  1. mybatisplus的坑 insert标签insert into select无参数问题的解决
  2. 关于Android(安卓)Studio3.2新建项目Android(安卓)resource link
  3. Android软键盘适配问题
  4. SlidingMenu和ActionBarSherlock结合做出出色的App布局,Facebook
  5. android解决坚屏拍照和保存图片旋转90度的问题,并兼容4.0
  6. android 系统中静音后使得音量减键不能解除静音
  7. Android(安卓)Calendar使用过程中遇到的问题
  8. flutter-使用第三方库,编译和运行版本不一致问题 2
  9. 解决Android(安卓)Studio和Android(安卓)SDK Manager无法在线更

随机推荐

  1. Android快速实现地图功能(不仅快!而且小!)
  2. Android(安卓)EditText清除焦点
  3. ios 类似android的toast
  4. Android(安卓)Studio官方文档之添加URL和
  5. Minecraft Earth将于下周迎来Android封测
  6. 趣拍SDK接入问题Android
  7. Android(安卓)设置无线热点模块隐藏SSID
  8. Android实现imageView在屏幕中缩放
  9. Android(安卓)EditText 的使用
  10. ubuntu下编译android源码、linux内核、an