In my activity I create 5 tabs dynamically.
I'm trying to figure out why my loading animation doesn't fill the whole space. Right now it's only a small rectangle in the top of the tab content (see http://imageshack.us/photo/my-images/594/loadingwf.png/).
Here is the code where I create the content of each tab :
for (int i = 0; i < NewsCategory.values().length; i++) {
View tabView = createTabView(tabHost.getContext(), NewsCategory.getValueAt(i).getName());
tabNewslist[i] = new Newslist(this, NewsCategory.getValueAt(i));
getLayoutInflater().inflate(R.layout.loading_anim, tabHost.getTabContentView(), true);
tabHost.addTab(tabHost.newTabSpec(NewsCategory.getValueAt(i).getName()).setIndicator(tabView).setContent(R.id.loadingAnim));
}
And here is the XML file of the animation :
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/loadingAnim"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="#FFFFFF"
android:gravity="center_horizontal"
android:orientation="horizontal"
android:padding="5dp" >
<ProgressBar
android:id="@+id/progressBar"
style="?android:attr/progressBarStyleSmall"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center_vertical"
android:text="@string/loading" />
</LinearLayout>