Modify Actionmode tab layout in Android-theme

Source: Internet
Author: User

1. Add <item name= "Android:actionbartabstyle" > @style/backupactionbartabview</item> in your theme theme

<resources> <style name= "Backuprestore.theme" parent= "@android: Style/theme.funui" > <item name= "an Droid:windowfullscreen ">true</item> <item name= "Android:actionbarstyle" > @style/actionbar_def_style</item> <item nam E= "Android:actionbartabstyle" > @style/backupactionbartabview</item> <item name= "Android: Actionbartabtextstyle "> @style/customactionbartabtextstyle</item> <item name=" Android:actionModeStyle "> @style/actionmode_def_style</item> </style>
<style name= "Customactionbartabtextstyle" > <item name= "Android:textcolor" > @color/action_bar_title_ text_color</item> <item name= "android:textsize" > @dimen/action_bar_title_text_size</item> & Lt;item name= "Android:paddingstart" > @dimen/action_bar_title_text_size</item> </style>
<style name= "Backupactionbartabview" parent= "@android: Style/widget.holo.light.actionbar.tabview" >
<item name= "Android:background" > #04cd74 </item>
<item name= "Android:gravity" >center_horizontal</item>
<item name= "Android:paddingstart" >66dip</item>
</style>


</resources>

2. In <style name= "Backupactionbartabview" parent= "@android: Style/widget.holo.light.actionbar.tabview" > Define related properties in

1) <item name= "Android:paddingstart" >66dip</item> This can change the position of the title, but it is always relative to the position within its own box, for example, if you have two headings, Then your first title will be a distance to the left screen 66dip, the second title will be separated from the middle of the position 66dip,<item name= "Android:paddingend" >66dip</item> properties similar to this

2) In fact <item name= "Android:actionbartabtextstyle" > @style/customactionbartabtextstyle</item> can also adjust the position of the title, But it adjusts the position of the text relative to the box <item name= "Android:paddingstart" > @dimen/action_bar_title_text_size</item>

However, these two use very inconvenient, as to how to let two headings to the middle of the method has not been found, after learning to add it

Modify Actionmode tab layout in Android-theme

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.