Image View ImageView 1. Using <ImageView/> in XML <ImageView android:id="@+id/imageView" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/inter" //The picture is stored in res/drawable-hdpi /> It can also be set in code like this: imageView.setImageResource(R.id.imageView);//同android:src="@drawable/inter" 2. Use the ImageView object to represent it in the code imageView = (ImageView)findViewById(R.id.imageView); 3. The magic ScaleType (stretched type) property Role: how the picture adapts to the size of the ImageView android:scaleType="fitCenter"//Equal scaling
Getting Started with Android. Image View ImageView
Guess you like
Origin http://10.200.1.11:23101/article/api/json?id=327059747&siteId=291194637
Recommended
Ranking