I have an image that I want to place in the center of the screen. Despite my expectations, it is centered horizontally, but not vertically. That is, the image touches the top of the screen.
The same layout shows OK in the sandbox project, but, unfortunately, not in real.
<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>
Lines
android:layout_centerHorizontal="true" android:layout_centerVertical="true"
Of course, they are not needed, but in any case it does not work.
Any suggestions are welcome.
EDIT: It looks like the view is shown using InputMethodService .
source share