How can I prevent word wrap in tab bar items in Holo theme?
2 answers
Have you tried using the attribute android:ellipsize
in xml or
setEllipsize(TextUtils.TruncateAt)
in a view that contains text? If the view inherits or is a textual view that should work. "If set, invokes words that are longer than sight, wide to be ellipsis rather than broken down the middle." Perhaps you can set the TextView as TabSpec withpublic TabHost.TabSpec setIndicator (View view)
0
source to share
You can control it,
Override this class in the ActionBarSherlock project./ActionbarSherlock/src/com/actionbarsherlock/internal/widget/ScrollingTabContainerView.java
@Override
public void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
super.onMeasure(widthMeasureSpec, heightMeasureSpec);
if (mParent.mMaxTabWidth > 0 && getMeasuredWidth() > mParent.mMaxTabWidth) {
//comment this line
// super.onMeasure(MeasureSpec.makeMeasureSpec(mParent.mMaxTabWidth, MeasureSpec.EXACTLY),heightMeasureSpec);
//now do nothing , override by me for ActionBarTabs not rezize never
//this method manage the size tabs, if you want you can count caracters to resize the size width
}
}
0
source to share