Hello everyone:
Imageview image width using adaptive problems, troubled for a long time
Currently code is:
android: clickable = "true"
android: padding = "0dip"
android: scaleType = "fitCenter"
android: layout_marginTop = "5dip"
android: layout_width = "fill_parent"
android: layout_height = "wrap_content"
android: layout_marginBottom = "5dip"
android: id = "@ + id / TrendFileImageView" />
The following questions arise
Image width is greater than view, you can width adaptation, but the height of poor control, the equivalent height is not adaptive (height refers to the view that the height), view there are gaps.
When the image width is less than the view, but also filled with discontent
I mainly want to achieve the effect of web page loading pictures, is to set the picture to 100%, highly adaptive.<-! Main posts under Banner (D4) -><-! Posts under the main text (D5) ->
Reply:
layout_height: wrap_content
layout_width: wrap_content
Reply:
This ultimately have to calculate the width of the screen, small pictures can be automatically scaled in the case setImageResource, but in SetImageBitmap case, can not be automatically extended, you also need Bitmap.CreateScaledBitmap this method to force the zoom image
No comments:
Post a Comment