画面の中央に配置したい画像があります。私の期待にもかかわらず、それは水平方向に中央揃えされていますが、垂直方向には中央揃えではありません。つまり、画像が画面上部に接触します。
同じレイアウトはサンドボックス プロジェクトでは問題なく表示されますが、残念ながら実際のプロジェクトではそうではありません。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<!-- ... -->
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<ImageView
android:id="@+id/progress2"
android:src="@drawable/wait2"
android:layout_centerInParent="true"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:visibility="visible"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
</RelativeLayout>
台詞
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
もちろん不要ですが、どちらの場合も物事は機能しません。
どんな提案でも大歓迎です。
編集: ビューがから表示されることが関連しているようInputMethodService
です。