android - 如何更改 Android 加载图标位置?

标签 android android-layout

第一张图片: enter image description here

第二张图片: enter image description here

第一个 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>

第二个 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>

请谁能帮我改变我的第一个加载,使它像第二个加载一样中间?

最佳答案

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

android:windowSoftInputMode="adjustPan" or "adjustResize"

关于android - 如何更改 Android 加载图标位置?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13946981/

相关文章:

java - 意外的顶级异常 - 多个库项目

android - 与 PCD/读卡器的安全元件通信

android - 未能创建部件的控件

android - 水平模式下的 NumberPicker

android - 如何在 Android 中使用滚动模式

java - android从布局xml动态添加元素

java - AppCompatActivity 的接口(interface)

android - 如何手动聚焦特定 View ?

android - 如何从协程 kotlin 获取值(value)?

Android Studio 的项目预览在新项目中是空白的