首页 > 移动平台 > 详细

Android 开发------------------ 修改 Actionbar 的样式

时间:2014-11-05 13:02:03      阅读:303      评论:0      收藏:0      [点我收藏+]

核心:  自定义的View

Android 开发------------------ 修改 Actionbar 的样式


Java代码:

actionBar = getSupportActionBar();  
  
ActionBar.Tab t = actionBar.getTabAt(i);  
t.setCustomView(R.layout.tab_layout_1);  
TextView title = (TextView)t.getCustomView().findViewById(R.id.tab_title);  
title.setBackgroundResource(R.drawable.detail);  
title.setText(sectionID);  


布局文件

<?xml version="1.0" encoding="utf-8"?>  
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"  
    android:layout_width="match_parent"  
    android:layout_height="match_parent"  
    >  
      
    <TextView  
        android:id="@+id/tab_title"  
        android:layout_width="wrap_content"  
        android:layout_height="wrap_content"  
        android:layout_marginTop="5dp"  
        android:layout_gravity="center_vertical|center"  
        android:textColor="@android:color/holo_blue_dark"  
        android:textSize="14sp" />  
  
</FrameLayout>  



Android 开发------------------ 修改 Actionbar 的样式

原文:http://blog.csdn.net/love_javc_you/article/details/40820735

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!