layout/tab_item_view.xml 部分代码

<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"    android:layout_width="wrap_content"    android:layout_height="wrap_content"    android:gravity="center"    android:orientation="vertical" >    <ImageView        android:id="@+id/imageview"        android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:focusable="false"        android:padding="3dp" >    </ImageView>    <TextView        android:id="@+id/textview"        style="@style/tab_item_text_style"        android:layout_width="wrap_content"        android:layout_height="wrap_content" >    </TextView></LinearLayout>

获得View 的方法

private View getTabItemView(int index) {View view = LayoutInflater.from(this).inflate(R.layout.tab_item_view,null);ImageView imageView = (ImageView) view.findViewById(R.id.imageview);TextView textView = (TextView) view.findViewById(R.id.textview);return view;}

更多相关文章

  1. ANDROID图片压缩代码
  2. Android 如何在Java代码中手动设置控件的marginleft
  3. android典型代码系列(十)------获取一个应用程序的权限信息(反射
  4. android 2.2+ 完全退出程序的方法今天贡献了
  5. Android保持屏幕常亮的方法
  6. android播放音乐文件代码
  7. android 4.0.3 dhcpcd使用方法
  8. Android camera调用出现错误解决方法
  9. Android Studio常见错误及解决方法汇总

随机推荐

  1. android studio更新到1.5后遇到的问题
  2. Android中简单的音乐播放器
  3. Momo自定义DialogFragment
  4. Android(安卓)CheckBox控件使用OnClickLi
  5. android WebView java与js相互调用
  6. Android(安卓)中的 R.class,减小 Apk 包大
  7. Android支持的媒体格式
  8. 使用ContentProvider时出现SecurityExcep
  9. android 两点缩放字体
  10. android快捷卸载第三方应用