How to make dynamically created ImageView full screen in Android in Viewpager

Source: Internet
Author: User
When I was doing something recently, there was a requirement to fill the screen with the picture that was used to viewpager the carousel, but the problem was that there was always a gap between the imageview and the screen, as shown here:
At that time the first reaction to consider using Layoutparam, but after several attempts to find a solution on the internet, as long as the creation of ImageView, the ImageView attribute ScaleType set to fit_xy then the problem solved, the specific code is as follows: ImageView imageview=new ImageView (context);
Imageview.setscaletype (SCALETYPE.FIT_XY);//Full screen
Then there is no space, just a record of the problem, there is no technology to say.

How to make dynamically created ImageView full screen in Android in Viewpager

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.