Note that there are some explanatory texts on larger screens.

plurals
  1. POandroid view pager image is stretched
    primarykey
    data
    text
    <ul> <li>I have added my splash screen image as a window background image of my splash activity.</li> <li>I have the same splash image as the first image in my walkthrough screen.</li> <li>Walkthrough screen has a view pager with 5 imageviews.</li> </ul> <p>Now I'm trying to add fadein animation from the splash screen to open the walkthrough activity.</p> <p>Problem here is the image that i have used in the splash and walkthrough(1st pic) is same. But the image in walkthrough is getting stretched when compared to the splash.</p> <p>How to show the images in walkthrough screen same as splash screen without getting stretched.</p> <p>CODE: 1. My view pager code in walkthrough activity</p> <pre><code>mViewPager = (ViewPager) findViewById(R.id.viewpager); mViewPager.setAdapter(new ViewPagerAdapter(this, mWalkThroughPic)); </code></pre> <ol> <li><p>Viewpager adapter code</p> <pre><code>public class ViewPagerAdapter extends PagerAdapter { Activity mActivity; int mImageArray[]; public ViewPagerAdapter(Activity act, int[] imgArra) { mImageArray = imgArra; mActivity = act; } public int getCount() { return mImageArray.length; } public Object instantiateItem(View collection, int position) { ImageView view = new ImageView(mActivity); view.setScaleType(ScaleType.FIT_XY); view.setImageResource(mImageArray[position]); ((ViewPager) collection).addView(view, 0); return view; } @Override public void destroyItem(View arg0, int arg1, Object arg2) { ((ViewPager) arg0).removeView((View) arg2); } @Override public boolean isViewFromObject(View arg0, Object arg1) { return arg0 == ((View) arg1); } @Override public Parcelable saveState() { return null; } </code></pre> <p>}</p></li> <li><p>Splash screen window background code used in splash theme :</p> <p>"&lt;"style name="SplashTheme" parent="@android:style/Theme.NoTitleBar" "&lt;"item name="android:windowBackground">@drawable/screen1"&lt;"/item> "&lt;"item name="android:windowNoTitle">true"&lt;"/item> "&lt;"/style> "</p></li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload