Android的ViewPager不上的Galaxy Nexus仅填充屏幕 [英] Android ViewPager not filling screen on Galaxy Nexus only
问题描述
我试图创造一个ViewPager,占用了整个屏幕。在ViewPager的每个片段里面,我有一个显示半透明图像的ImageView的。
I'm trying to create a ViewPager that takes up the entire screen. Inside each fragment of the ViewPager, I have an ImageView that displays a semi-transparent picture.
由于某些原因,当我尝试我上的Galaxy Nexus(4.0.4)的解决方案,它留下的ViewPager的左侧和右侧边框,如下图所示:
For some reason, when I try my solution on a Galaxy Nexus (4.0.4), it leaves a border on the left and right side of the ViewPager, as shown below:
我已经试过这对下列设备和它的不可以给这个问题:
I've tried this on the following devices and it does not give that problem:
- 的Nexus S(4.1.1)
- 的Nexus One(2.3.6)
- EVO 4G(CM7.2,2.3.7)
- Android模拟器
会有人能够采取一看简化源$ C $ C 并帮助我出去(特别是如果你有一个Galaxy Nexus的)?谢谢!
Would anyone be able to take a look at the simplified source code and help me out (especially if you have a Galaxy Nexus)? Thanks!
顺便说一下,这是解决一个<一个企图href=\"http://stackoverflow.com/questions/12013334/how-do-you-create-a-transparent-demo-screen-for-an-android-app\">earlier问题的我,对此我无法得到正确的答案。
Btw, this is an attempt to solve an earlier question myself, for which I couldn't get a proper answer.
推荐答案
我通过我的$ C $走到C再次,试图评论/取消注释部分,看看我是否能摆脱这个问题。
I went through my code again and tried commenting/uncommenting sections to see if I could get rid of the problem.
我把范围缩小到我申请到我的活动自定义样式。在这里面,我有以下项目:
I narrowed it down to the custom style I was applying to my activity. In it, I had the following item:
<item name="android:windowIsFloating">true</item>
删除这个项目解决了该问题,但我还是不明白为什么。也许一些与此相关的问题 - <一个href=\"http://stackoverflow.com/questions/7888263/how-to-create-a-transparent-activity-without-windowisfloating\">How创建一个透明的活动,而windowIsFloating
我原本包括阅读下面的问题后,这个项目 -
如何在Android中创建透明的活动?
I had originally included this item after reading the following question - How to create Transparent Activity in Android?
无论如何,我希望这样可以节省别人的时间显著量调试。
Anyway, I hope this saves someone else a significant amount of time in debugging.
这篇关于Android的ViewPager不上的Galaxy Nexus仅填充屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!