我有一个想要放在屏幕中央的图像.尽管我的期望,它是水平居中但不是垂直居中.也就是说,图像触摸屏幕顶部.
相同的布局在沙箱项目中显示正常,但遗憾的是不是真实的.
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
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"
/>
线条
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
当然是不必要的,但在任何一种情况下都不起作用.
欢迎任何建议.
编辑:看起来与InputMethodService显示视图是相关的.