मुझे ImageView के getWidth/getheight फ़ंक्शन के साथ समस्या हो रही है। मेरे एक्सएमएल इस प्रकार है के रूप में:एंड्रॉइड इमेज व्यू रिटर्न GetWidth, getHeight शून्य
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/bonus_popup"
android:visibility="gone"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ImageView
android:id="@+id/todaybonus"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:adjustViewBounds="true"
android:src="@drawable/startscreen_todaybonus" />
<ImageView android:id="@+id/ok_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:onClick="acceptBonus"
android:background="#000000"></ImageView>
</RelativeLayout>
और मेरे कोड इस प्रकार है:
if (isDisplayBonus){
set_blur_background();
bonusPopup.setVisibility(0);
Log.i(TAG, "Bonus width: " + todayBonus.getWidth());
Log.i(TAG, "Bonus height: " + todayBonus.getHeight());
}
कृपया मदद मुझे इस समस्याओं का समाधान ,. पहले ही, आपका बहुत धन्यवाद।
यहां बोनस क्या है? कम से कम प्रासंगिक भाग पेस्ट करें। –
हाय गौरव, बोनसपॉप –
गतिविधि कोड है? ऊपर से नीचे तक। –