我写了一个自定义控件,可是不管怎么设置它都不能居中,始终在左上角的位置。。。
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#f00"
>
<com.example.gifdemo.MyGifView
android:id="@+id/gv"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
/>