Android:Layout move upwards & about 20dp area from the top hides behind the status bar

依然范特西╮ 提交于 2019-12-11 13:10:22

问题


I am using this link! for cropping an image and after getting the cropped image somehow whole layout moves about 20dp upwards and hides behind the status bar (this is random behaviour i.e happens sometimes) I tried many things to fix this problem but couldn't get to the solution, mainly because I dont know what is causing the problem.

This is a device specific problem, occurs occasionally in galaxy s and htc desire but frequently on samsung Ace. I tested app on samsung note and htc desire HD it works fine no such problem in these devices.

There is one more thing I should mention here that is: when layout hides under the status bar if I popup the keyboard by clicking on textfield layout gets back to normal i.e hidden area gets visible again.

I cannot attach the image but found similar question Android - Status bar hides part of view sometimes exactly this is the behaviour of my layout.

Note:Recently i found out that camera activity is causing the layout to move upwards. To verify this start camera in samsung Galaxy Ace and just press back and note the layout movement in icons of home screen.


回答1:


I have fixed the problem by using crop method inside the camera activity check this Set Camera Size - Parameters vs Intent? last answer of the post helped me to solve the issue.



来源:https://stackoverflow.com/questions/15600450/androidlayout-move-upwards-about-20dp-area-from-the-top-hides-behind-the-stat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!