我的確切目的閃屏的中心規模大小,地點圖像是減少圖像的大小(高度和寬度)略(如WRAP_CONTENT尺寸過大),並把它放在中心初始屏幕。但是不管我做什麼,它只是在我使用wrap_content或match_parent之前不會居中。這是我使用的代碼。如何在Android應用程序
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.yoalfaaz.yoalfaaz.SplashScreen">
<ImageView
android:layout_width="300dp"
android:layout_height="300dp"
tools:layout_editor_absoluteY="25dp"
tools:layout_editor_absoluteX="25dp"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:src="@drawable/ss" />
</android.support.constraint.ConstraintLayout>
什麼是最好的方式去做它,因爲設置一個前綴大小,因爲我不會讓它適應更大的屏幕(主要是平板電腦)。
什麼是父面板?線性?相對? –
@ d.moncada你能告訴我該如何檢查。我仍然是Android的初學者,所以我很困惑。雖然我編輯了這個問題以提供有關activity_splash_screen.xml文件的所有內容,但也許可以提供幫助。 –
您的編輯說明我需要什麼,感謝 –