Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stop titles in Android tabs from wrapping in the middle of a word?

I have a layout with several tabs. What's happening is that in landscape orientation, the layout is wrapping the text used in the tab titles, but not on a word - its wrapping in the middle of a word! So a title like:

Description  

looks fine in portrait but in landscape is shown like this:

Desc  
ript  
ion

I'm not specifying any word wrap or style attributes for the text. I would imagine the layout would have more space in landscape mode than portrait, so this makes no sense. Would appreciate any advice on what to look at.

like image 853
Eno Avatar asked Mar 23 '11 13:03

Eno


People also ask

How do I stop word wrapping?

Enable or disable text wrapping for a text box, rich text box, or expression box. Right-click the control for which you want to enable or disable text wrapping, and then click Control Properties on the shortcut menu. Click the Display tab. Select or clear the Wrap text check box.

What is text wrapped in is called?

The object that text wraps around is called the wrap object. Text wrap is also referred to as runaround text.

In which tab will you find Wrap Text option?

On the Home tab, in the Alignment group, click Wrap Text.


1 Answers

Late response, but Google brought me here, so this might be useful still.

You can choose to scroll the tabs, which I believe is preferable to changing font sizes.

app:tabMode="scrollable"

<android.support.design.widget.TabLayout
        android:id="@+id/tablayout_id"
        android:layout_height="wrap_content"
        android:layout_width="match_parent"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        app:tabMode="scrollable"
        >
like image 199
RedHotPawn.com Avatar answered Sep 24 '22 15:09

RedHotPawn.com