question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

android:layout_centerInParent="true" not working in app

See original GitHub issue

android:layout_centerInParent="true" not working in app

My app requirement is screenshot_2016-05-06-12-45-46

But Result is screenshot_2016-05-06-12-45-28

my XML code is ; <ImageView android:id="@+id/image" android:layout_width="match_parent" android:layout_height="match_parent" android:layout_centerInParent="true" android:contentDescription="@string/descr_image" android:scaleType="center" />

How should i overcome this problem…?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Reactions:1
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Lynpocommented, Sep 9, 2016

I met the same issue, I solved this issue by add a Listener to my image loader(Glide, or Picasso), invoke the method of PhotoViewAttacher’s update() method while your image loader is ready. I used Glide to load my remote image, the code is: Glide.with(Context).load(url).listener(new RequestListener(){ onResourceRedy(){ mAttacher.update();}}).into(mImageView); and it works fine. @Reference:http://stackoverflow.com/questions/21749374/picasso-and-photoview-library-loads-image-into-imageview-weird

1reaction
kiaanpillaycommented, May 25, 2016

I have this same issue and it works without the lib, but moves the image to the top of the screen with the lib

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix an installed Android app that isn't working - Google Support
Try the following steps if an app installed on your phone has any of these problems: Crashing. Won't open. Won't respond. Isn't working...
Read more >
Android Apps Not Working? Try These Fixes - YouTube
The number of apps available on Android is what makes the platform great, so it's natural that we want them to work properly....
Read more >
What to do if an App is Suddenly not Working ... - YouTube
Android comes with a feature which allows you to reset an app by clearing all the data stored in it. Once done, this...
Read more >
How To Fix Apps Stopped Working and Crashing error on ...
Looking for the best smartphone or equipment? Never miss today's deals on Amazon here https://geni.us/vYJlLb In this video, we'll show you ...
Read more >
How To FIX Android Apps Not Loading! (2022) - YouTube
Get The Cheapest iPhones Here: https://amzn.to/3JTnWArGet The Cheapest Androids Here: https://amzn.to/3r2k1stFollow Me On Twitter: ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found