views:

32

answers:

1

Why does the tab text overlap the drawable in the tab? Is there a way to prevent this? Is the drawable always centered? What's the point of being able to add text as well as a drawable to the indicator if it gives this output.

alt text

xml

<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"    
    android:id="@android:id/tabhost"    
    android:layout_width="fill_parent"    
    android:layout_height="fill_parent">    
    <LinearLayout        
        android:orientation="vertical"        
        android:layout_width="fill_parent"        
        android:layout_height="fill_parent"        
        android:padding="5dp">  
        <TabWidget            
            android:id="@android:id/tabs"            
            android:layout_width="fill_parent"            
            android:layout_height="wrap_content"/>        
        <FrameLayout            
            android:id="@android:id/tabcontent"            
            android:layout_width="fill_parent"            
            android:layout_height="fill_parent"            
            android:padding="5dp" />  
</LinearLayout>
</TabHost>

java


 host.addTab(host.newTabSpec("_tab2") 
                .setIndicator("Authors",res.getDrawable(android.R.drawable.ic_menu_mapmode))  
                .setContent(new Intent(this, AuthorList.class)));

Can anyone else help? I've tried everythin I can think of and it looks like this both in my phone and my emulator. I've used tabs before and it didn't do this.

A: 

in each instance that I've used this, Its worked for me, but for you the only thing I see that may help, is try upping the padding just a tiny bit, check out if it works better with more padding to the word

Samuel
Add padding to which exactly?
Falmarri
What are you using the frame layout for?
Samuel