Android Picasso resize() not consistent

[postlink] https://the-best-way-of-life-is-islam.blogspot.com/2015/07/android-picasso-resize-not-consistent.html [/postlink]

I am using Picasso to resize my background images on my Android interface.

I am stretching the width of the image to fill the width, but I cannot adjust the height, as the background image needs to line up with the circular image in the middle.

Problem is that on different devices, the height appears to adjust as the background is not positioned consistently. I would post an example but I can't as I dont have 10 reputation yet.

Here is my java

ImageView imgBackground = (ImageView) v.findViewById(R.id.imgBackground);
aParent = (MainActivity) getActivity();

//Picasso.with(getActivity()).load(R.drawable.morn_blur_bg).fetch();
Picasso.with(aParent.getApplicationContext())
        .load(R.drawable.morn_blur_bg)
        .resize(aParent.getBackgroundWidth(), aParent.getBackgroundHeight())
        .into(imgBackground);

And this is my XML

<ImageView
    android:id="@+id/imgBackground"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:scaleType="center"
    android:layout_alignParentTop="true" />

Any help is greatly appreciated.

اذا أعجبك الموضوع ساهم في نشره :

Enregistrer un commentaire

 
حقوق النشر: Published by | Template Created by | القناة على اليوتيب
copyright © 2014. The Best Way Of Life Is Islam -يمكن نقل كل ما هو موجود في موقع الرحمة تيوب
القرآن الكريم و الأحاديث النبوية أناشيد و دروس اسلامية منوعة موقع الفيديوهات الاسلامية
تطوير و تعريب مدونة ثعلوب