我已經使用'pl.droidsonroid.g.g.GifImageView'爲gif圖像。但它需要默認大小。如果我嘗試給一些寬度和高度比它不會採取給定的大小作爲默認值apper。我無法手動設置寬度和高度爲'pl.droidsonroids.gif.GifImageView'視圖
我的XML是:
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="5">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:weightSum="10"
android:layout_marginTop="@dimen/_1sdp"
android:layout_marginBottom="@dimen/_30sdp"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:gravity="center"
android:layout_weight="7.4">
<pl.droidsonroids.gif.GifImageView
android:id="@+id/gifImageView2"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="@drawable/hubcreategif1"
android:layout_marginTop="0dp"
android:layout_gravity="center"
android:layout_marginBottom="10dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="3.0"
android:layout_marginBottom="0dp"
android:gravity="center"
android:layout_gravity="center_vertical"
android:orientation="vertical">
<LinearLayout
android:id="@+id/layout_hubmessage"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:visibility="visible"
android:gravity="center"
android:layout_gravity="center"
android:orientation="vertical">
<TextView
android:id="@+id/tv_lbldonthave"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="You don't have a hub history yet."
android:layout_gravity="center_horizontal"
android:textSize="@dimen/_11sdp"
android:textColor="@color/colordarkgray"
/>
<TextView
android:id="@+id/tv_strcomeback"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/strcomeback"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:textSize="@dimen/_11sdp"
android:textColor="@color/colordarkgray"
/>
<TextView
android:layout_width="match_parent"
android:layout_height="@dimen/_17sdp" />
</LinearLayout>
<LinearLayout
android:id="@+id/layout_onboard"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="@dimen/_15sdp"
android:layout_marginRight="@dimen/_15sdp"
android:visibility="gone"
android:layout_gravity="center_vertical"
android:gravity="center_horizontal"
android:orientation="vertical">
<TextView
android:id="@+id/tv_1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/_22sdp"
android:text="@string/strcreateorjoin"
android:gravity="center_horizontal"
android:layout_marginTop="1dp"
android:layout_gravity="center_horizontal"
android:textColor="@color/colorBlack"/>
<TextView
android:id="@+id/tv_2"
android:layout_width="match_parent"
android:layout_marginLeft="@dimen/_35sdp"
android:layout_marginRight="@dimen/_35sdp"
android:layout_height="@dimen/_2sdp"
android:layout_marginTop="@dimen/_7sdp"
android:background="@drawable/dotted_bottom_textview_black"
/>
<TextView
android:id="@+id/tv_3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_10sdp"
android:layout_marginRight="@dimen/_10sdp"
android:textSize="@dimen/_11sdp"
android:textAppearance="?android:attr/textAppearanceSmall"
android:text="@string/strhubdetail"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/_5sdp"
android:textColor="@color/colordarkgray"/>
<TextView
android:id="@+id/tv_4"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/_10sdp"
android:layout_marginRight="@dimen/_10sdp"
android:textSize="@dimen/_11sdp"
android:text="@string/strhubabort"
android:layout_gravity="center_horizontal"
android:gravity="center_horizontal"
android:layout_marginTop="@dimen/_11sdp"
android:visibility="gone"
android:textColor="@color/colordarkgray"/>
</LinearLayout>
</LinearLayout>
<TextView
android:layout_width="match_parent"
android:layout_weight="2.5"
android:layout_height="0dp" />
</LinearLayout>
</RelativeLayout>
和java類是:
gifImageView =(pl.droidsonroids.gif.GifImageView)findViewById(R.id.gifImageView2);
沒有別的
發表您的XML和Java類,請 –
我已編輯問題與XML和Java代碼 –
好吧,那麼你在屏幕上的「默認大小」是什麼意思你看到什麼? –