Vacxe2013-02-18 16:17:20
Vacxe, 2013-02-18 16:17:20

2 lines in ActionBarSherlock?

Dear comrades, during the development of the application and the receipt of layouts, it became necessary to make two lines in the ABS in the TitleBar. Racking my head, I did not find a solution anywhere.
It seems that everything is correct in the description of the topic for Title. The color and size change well, but the lines do not. There is only one line at the end.
Thanks for the help.

<style name="actionBar" parent="@style/Widget.Sherlock.Light.ActionBar">
        <item name="android:background">@drawable/title_background</item>
        <item name="background">@drawable/title_background</item>
        <item name="titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item>
        <item name="android:titleTextStyle">@style/Widget.MyApp.TitleTextStyle</item>

    <style name="Widget.MyApp.TitleTextStyle" parent="TextAppearance.Sherlock.Widget.ActionBar.Title">
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:textSize">13dp</item>
        <item name="android:singleLine">false</item>
        <item name="android:lines">2</item>
        <item name="android:layout_marginLeft">5dp</item>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
palmut, 2013-02-18

Unfortunately, you will not be able to do this - in the layout it is hardcoded for the title in the singleLine = "true" attributes, and the second line is used for the subtitle. You can either use a subtitle for the second line, or put your own TextView on the ABS via setCustomView.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question