How to make dynamically created ImageView full screen in Android in Viewpager
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:
Programme one:
ImageView imageview=new ImageView (context);
Imageview.setscaletype (SCALETYPE.FIT_XY);//Full screen
Scenario Two:
<com.huicuitongkeji.ysb.instructions.ViewPagerCompate android:id="@+id/viewpager " android:layout_width="match_parent" android: Layout_height="match_parent"
And then the void will not exist.
Reprint to: http://www.th7.cn/Program/Android/201409/279093.shtml
Android FAQ's Collection