problem IMAGEVIEW.SRC set the picture resource, the picture does not stretch, but has the void part:
<linearlayout
android:id= "@+id/linearlayout1"
android:layout_width= "Wrap_content"
android: layout_height= "Wrap_content"
android:orientation= "vertical" >
<imageview
android:layout_width = "Wrap_content"
android:layout_height= "205DP"
android:scaletype= "Centerinside"
android:background = "@drawable/feature_guide_1" >
</ImageView>
</LinearLayout>
FIX: There is no gap in the following settings
<linearlayout
android:id= "@+id/linearlayout1"
android:layout_width= "Match_parent"
android: layout_height= "Wrap_content"
android:orientation= "vertical" >
<imageview
android:layout_width = "Wrap_content"
android:layout_height= "wrap_content"
android:layout_gravity= "center"
android: Adjustviewbounds= "true"
android:scaletype= "Fitxy"
android:src= "@drawable/feature_guide_0" >
</ImageView>
</LinearLayout>
The following is a reprint of the reference content:
Recently encountered a demand, the requirement is not aware of the picture width and height of the case, let the picture in the specified width, while highly adaptive, in the network to find a bit, there are many solutions, and then for their own application, chose a modified smaller scheme, and finally proved that the effect is pretty good, recorded here, Hope to help people with the same needs.
Okay, here we are.
First, you need to add android:adjustviewbounds= "true" to your ImageView layout
<imageview android:id= "@+id/test_image"
Android:layout_width= "Wrap_content"
android:layout_height= "Wrap_content"
Android:scaletype= "Fitxy"
Android:adjustviewbounds= "true"
android:layout_gravity= "Center"
android:contentdescription= "@string/app_name"
android:src= "@drawable/ic_launcher"/>
Then, set the ImageView in the code. Maximum width and maximum height, because the Adjustviewbounds property only works if the maximum height and maximum width are set
int screenwidth = Getscreenwidth (this);
Viewgroup.layoutparams LP = Testimage.getlayoutparams ();
Lp.width = ScreenWidth;
Lp.height = layoutparams.wrap_content;
TESTIMAGE.SETLAYOUTPARAMS (LP);
Testimage.setmaxwidth (ScreenWidth);
Testimage.setmaxheight (ScreenWidth * 5); It can actually be based on demand, and I'm testing 5 times times the maximum width here.
OK, next, then the normal way to load the picture will get the expected effect, the students need to try, good luck.