(reproduced) android:visibility and Android:scaletype properties

Source: Internet
Author: User

1.android:visibility= "Gone"

It has three properties: visible display; invisible display black background bar; gone not displayed

2.android:scaletype Property

imageview.scaletype.center|android:scaletype= "Center" is based on the geometric center point of the original image and the geometric center point of the Imagview, centered on the original size of the picture, not scaled, When the picture is longer/wider than the length/width of the view, the center portion of the captured picture displays the size of the ImageView. When the picture is smaller than the width of the view, only the size of the picture is displayed, not clipped.

imageview.scaletype.center_crop|android:scaletype= "Centercrop" is based on the geometric center point of the original image and the geometric center point of the Imagview, scaled up ( Image is smaller than the width of the view) the size of the picture is centered so that the picture is longer (wide) equal to or greater than the view's length (width), and the image is truncated by the size of the view. When the size of the original image is greater than imageview, proportionally reduce the picture, so that the length of the width of the imageview has always been equal to the other has always been greater than ImageView. In fact, make the original size greater than or equal to ImageView

The imageview.scaletype.center_inside|android:scaletype= "Centerinside" is based on the geometric center point of the original and the geometric center point of the Imagview, Displays the contents of the picture in full, by proportionally narrowing the original size so that the picture is long (wide) equal to or less than ImageView long (wide)

imageview.scaletype.fit_center|android:scaletype= "Fitcenter" expands the picture proportionally (shrinks) to the width of the view, centered

imageview.scaletype.fit_end|android:scaletype= "Fitend" expands the picture proportionally (shrinks) to the width of the view, displayed in the lower part of the view

imageview.scaletype.fit_start|android:scaletype= "Fitstart" expands the picture proportionally (shrinks) to the width of the view, displayed in the upper part of the view

imageview.scaletype.fit_xy|android:scaletype= "Fitxy" displays the picture in the view at the specified size, stretches the picture, does not maintain the original proportions, fills the view.

imageview.scaletype.matrix|android:scaletype= "Matrix" is drawn with matrix

In my opinion, the types of scaletype are divided into three types of matrix (default), Fit-x class, and center class. The matrix doesn't say much.

In the Fit-x class, the Fitstart, Fitcenter, and Fitend are adapted to the Imgview as needed, not clipped, and drawn by the Matrix, but they
The difference is that the benchmark is different. The Datum of the Fitstart is the top point (that is, the point at which the matrix starts) and the Fitcenter datum point is the midpoint.
(The point at which the picture can be centered in matrix mode), while the Fitend datum point is the point at the lower-right corner (that is, the matrix is the last draw point).

In the center class, center, Centercrop, and Centerinside are all based on the geometric center point of the original and the geometric center point of the Imagview, and only draw
Imagview size of the image, the difference is whether to maintain the original size of the drawing and the target of different, the means adopted.

Original address: http://blog.csdn.net/buaaroid/article/details/26457775

(reproduced) android:visibility and Android:scaletype properties

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.