简体   繁体   中英

How to change Android Loading icon position?

First image: 在此输入图像描述

Second image: 在此输入图像描述

First XML:

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:padding="10dp" >

    <EditText
        android:id="@+id/text"
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="99.81"
        android:ems="10"
        android:hint="@string/search_hint" />

    <ImageButton
        android:id="@+id/add"
        android:layout_width="35dp"
        android:layout_height="match_parent"
        android:layout_weight="4.47"
        android:background="@drawable/search_button"
        android:contentDescription="@string/desc"
        android:src="@drawable/ic_menu_search_bar" />
</LinearLayout>

<View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#dddddd" />

<FrameLayout
    android:id="@+id/player_frag_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</FrameLayout>

Second XML:

<LinearLayout
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:padding="10dp" >

    <Button
        android:id="@+id/list_view_upcoming"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/label_upcoming"
        android:layout_weight="1" />

    <Button
        android:id="@+id/list_view_completed"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="@string/label_completed" />
</LinearLayout>

<View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#dddddd" />

<FrameLayout
    android:id="@+id/fragment_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</FrameLayout>

Please anyone who can help me change my first loading to make it middle like second loading?

尝试在Manifest.xml中使用以下活动属性

android:windowSoftInputMode="adjustPan" or "adjustResize"

I am already solved it.

i changed layout height on second xml to:

 <LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:gravity="center"
    android:padding="10dp" >

    <Button
        android:id="@+id/list_view_upcoming"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/label_upcoming"
        android:layout_weight="1" />

    <Button
        android:id="@+id/list_view_completed"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:text="@string/label_completed" />

</LinearLayout>

<View
    android:layout_width="fill_parent"
    android:layout_height="1dp"
    android:background="#dddddd" />

<FrameLayout
    android:id="@+id/fragment_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent" >
</FrameLayout>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM