码迷,mamicode.com
首页 > 移动开发 > 详细

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

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

标签:android   style   blog   http   io   color   ar   java   sp   

核心:  自定义的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 的样式

标签:android   style   blog   http   io   color   ar   java   sp   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!