I have some spinners on the layout and use loader to load their data from db in background. The problems is that empty spinners have smaller height until the data are loaded. So the layout jump.
How can I prevent this jumping?
Edit (added spinner row layouts)
Spinner row:
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/Text1"
style="@style/StyleSpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Spinner drop down row:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="@dimen/style_spinner_row_padding" >
<TextView
android:id="@+id/Text1"
style="@style/StyleSpinnerDropDownRow1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true" />
<TextView
android:id="@+id/Text2"
style="@style/StyleSpinnerDropDownRow2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_below="@+id/Text1" />
</RelativeLayout>
Assigned styles:
<!-- // Spinner // -->
<style name="StyleSpinner" parent="AppTheme">
<item name="android:textStyle">bold</item>
<item name="android:gravity">start</item>
<item name="android:textSize">@dimen/default_text_size_normal</item>
<item name="android:padding">@dimen/style_spinner_row_padding</item>
</style>
<style name="StyleSpinnerDropDownRow1" parent="AppTheme">
<item name="android:textStyle">bold</item>
<item name="android:textSize">@dimen/default_text_size_normal</item>
</style>
<style name="StyleSpinnerDropDownRow2" parent="AppTheme">
<item name="android:textStyle">normal</item>
<item name="android:textSize">@dimen/default_text_size_small</item>
</style>
Screen shots: