-1
我正在開發一個使用.gif文件的應用程序。
我發現了很多衝浪後如何在Android中實現gif,但現在的問題是我無法在中心對齊gif。 我嘗試過使用重力作爲中心,但它沒用。如何使gif文件出現在屏幕的中心
任何人都可以幫助我嗎?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:components="http://schemas.android.com/apk/lib/com.sample.hello"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<com.sample.hello.GIFView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_gravity="center"
components:src="@drawable/gifid"
/>
</LinearLayout>
更好地利用:'機器人:layout_centerInParent =「真」'(一個屬性,而不是二) –
好點,我忘了該屬性。 –
它發生在最偉大的...;) –