android - Sherlock actionbar tab not shown when increase the actionbar size -
i want customize sherlock actionbar , tab.
as have show app icon image in approximate 100-150dp size , bottom app icon have display tab.
just way
so tried code in styles
<style name="theme.style.login" parent="@style/theme.sherlock.light"> <!-- api level <11---> <item name="actionbarstyle">@style/theme.white_style</item> <item name="actionbartabstyle">@style/customloginactionbartabstyle</item> <item name="actionbartabbarstyle">@style/customloginactionbartabdividerstyle</item> <!-- api level <11---> <!-- api level >=11---> <item name="android:actionbartabbarstyle">@style/customloginactionbartabstyle</item> <item name="android:actionbarstyle">@style/theme.white_style</item> <item name="android:actionbartabbarstyle">@style/customloginactionbartabdividerstyle</item> <!-- api level >=11---> </style> <!-- signup login tab style theme --> <style name="customloginactionbartabstyle" parent="@style/widget.sherlock.light.actionbar.tabview"> <item name="android:background">@drawable/actionbar_tabs_selector_loginsignup</item> </style> <style name="customloginactionbartabdividerstyle" parent="@style/widget.sherlock.actionbar.tabbar"> <item name="divider">@null</item> <item name="android:divider">@null</item> </style> <style name="theme.white_style" parent="@style/theme.sherlock.light"> <item name="actionbarsize">@dimen/loginactionbar</item> <item name="android:actionbarsize">@dimen/loginactionbar</item> </style>
and on.
and here activity code
public class signuploginactivity extends sherlockactivity implements actionbar.tablistener { public static int theme = r.style.theme_style_login; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); settheme(theme); setcontentview(r.layout.main); actionbar actionbar = getsupportactionbar(); actionbar.setcustomview(r.layout.login_actionbar_customeview); actionbar.setdisplayshowtitleenabled(false); actionbar.setdisplayshowcustomenabled(true); actionbar.setlogo(null); view homeicon = findviewbyid( build.version.sdk_int >= build.version_codes.honeycomb ? android.r.id.home : r.id.abs__home); ((view) homeicon.getparent()).setvisibility(view.gone); ((view) homeicon).setvisibility(view.gone); /* * adding tab */ actionbar.setnavigationmode(actionbar.navigation_mode_tabs); (int = 1; <= 2; i++) { actionbar.tab tab = actionbar.newtab(); tab.settext("tab " + i); tab.settablistener(this); actionbar.addtab(tab); } } @override public void ontabselected(tab tab, fragmenttransaction ft) { // todo auto-generated method stub } @override public void ontabunselected(tab tab, fragmenttransaction ft) { // todo auto-generated method stub } @override public void ontabreselected(tab tab, fragmenttransaction ft) { // todo auto-generated method stub } }
so in case able increase actionbar height actionbar tab not showing how achieve result want.
finally achived desire solution way
<!-- api level <11 --> <style name="theme.style.login" parent="@style/theme.sherlock.light"> <item name="actionbartabstyle">@style/customloginactionbartabstyle</item> <item name="actionbardivider">@null</item> // remove divider between tabs <item name="actionbartabtextstyle">@style/customelogintabtextstyle</item> // increase tab text size <item name="actionbarsize">@dimen/loginactionbar</item> // increase actionbar size </style> <!-- api level <11 --> <!-- api level >=11 --> <style name="theme.style.login" parent="@style/theme.sherlock.light"> <item name="android:actionbartabstyle">@style/customloginactionbartabstyle</item> <item name="actionbardivider">@null</item> // remove divider between tabs <item name="android:actionbartabtextstyle">@style/customelogintabtextstyle</item> // increase tab text size <item name="android:actionbarsize">@dimen/loginactionbar</item> // increase actionbar size </style> <!-- api level >=11 --> <!-- api level >=14 --> <style name="theme.style.login" parent="@style/theme.sherlock.light"> <item name="android:actionbartabstyle">@style/customloginactionbartabstyle</item> <item name="android:actionbardivider">@null</item> // remove divider between tabs <item name="android:actionbartabtextstyle">@style/customelogintabtextstyle</item> // increase tab text size <item name="android:actionbarsize">@dimen/loginactionbar</item> // increase actionbar size </style> <!-- api level >=14 --> <!-- signup login tab style theme --> <style name="customloginactionbartabstyle" parent="@style/widget.sherlock.light.actionbar.tabview"> <item name="android:background">@drawable/actionbar_tabs_selector_loginsignup</item> <item name="android:paddingtop">20dp</item> </style> <style name="customelogintabtextstyle" parent="widget.sherlock.actionbar.tabtext"> <item name="android:textcolor">@color/countryname</item> <item name="android:textsize">@dimen/logintabtxtsize</item> </style>
Comments
Post a Comment