简体   繁体   English

Eclipse Android开发中的图形布局滚动问题

[英]Graphical Layout Scroll Problem in Eclipse Android Development

I am trying to develop an android application. 我正在尝试开发一个Android应用程序。 I've put a scroll view as main container using graphical layout in eclipse. 我在eclipse中使用图形布局将滚动视图作为主容器。 After that, I had put some UI elements, like buttons. 之后,我放了一些UI元素,比如按钮。 When the total height of elements become more than viewable area, it can be seen using scroll view as expected. 当元素的总高度变得大于可视区域时,可以使用滚动视图按预期看到它。 There is no problem until this point. 到目前为止没有问题。 The problem is the elements that are not fit viewable are of the screen can not be seen using graphical container of the eclipse interface. 问题是使用eclipse界面的图形容器无法看到屏幕不适合查看的元素。 There is no problem with the source code, as it runs expectedly. 源代码没有问题,因为它预期运行。 Is there any option in the Eclipse gui to see the UI elements that are not fit the viewport? Eclipse gui中是否有任何选项可以查看不适合视口的UI元素?

I know what you're talking about. 我知道你在说什么。 When you're viewing the xml file on the Eclipse Graphical layout you can only see the elements that fit on the screen. 当您在Eclipse Graphical布局上查看xml文件时,您只能看到适合屏幕的元素。 You can't scroll down to see the entire UI. 您无法向下滚动以查看整个UI。

I use Eclipse at home and work. 我在家里和工作中使用Eclipse。 I'm using Eclipse Helios Service Release 1, on both systems. 我在两个系统上都使用Eclipse Helios Service Release 1。 For some reason at home, when I'm on the graphical layout, there's a button on the upper right of the graphical viewer that says something like 'Remove Clipping'. 出于某种原因,在家里,当我在图形布局上时,图形查看器的右上角有一个按钮,上面写着“删除剪辑”。 (I'm at work now. So can't look to see exactly what it says). (我现在在工作。所以不能确切地看到它的内容)。

When I click that button, I can now scroll down to see the entire UI. 当我点击该按钮时,我现在可以向下滚动以查看整个UI。 However, on my copy of Eclipse at work that same button isn't displayed. 但是,在我的Eclipse副本上工作时,不会显示相同的按钮。 I've tried to figure out what the difference is between the setup on the two copies of Eclipse. 我试图找出Eclipse的两个副本上的设置之间的区别。 But so far haven't been able to figure it out. 但到目前为止还没有弄清楚。 Note, I've tried viewing the same exact xml file, within the same project, on both copies of Eclipse. 注意,我已经尝试在Eclipse的两个副本上查看相同项目中的完全相同的xml文件。

The problem seems to only occur when you're using a scrollview and all the ui elements won't fit on the graphical layout screen within Eclipse. 问题似乎只发生在使用scrollview时,并且所有ui元素都不适合Eclipse中的图形布局屏幕。

I have the same problem. 我也有同样的问题。 I've been unable to troubleshoot, so I've resorted to using my physical device instead. 我一直无法排除故障,因此我使用了我的物理设备。 I try to get the bulk of work done within the the Eclipse GUI... then nudge and polish with my device. 我尝试在Eclipse GUI中完成大量工作...然后用我的设备轻推和润色。 Its a PITA to be sure, uploading what seems like a million times only to move one element a tiny bit more. 它确实是一个PITA,上传的内容似乎只有一百万次才能将一个元素移动一点点。

Best practices recommend developing on a device. 最佳做法建议在设备上进行开发。 Further, the Layout-tools && scrollView basically make it mandatory to really know what is going on. 此外,Layout-tools && scrollView基本上使得必须真正知道发生了什么。 I can't seem to form this into a coherent search argument as my Google-fu has let me down on this one. 我似乎无法将此形成一个连贯的搜索论点,因为我的Google-fu已经让我失望了。

BTW - I'm using the shiny new r10 ADT plugin and I've been struggling with this for about 6 months. 顺便说一句 - 我正在使用闪亮的新r10 ADT插件,我一直在努力解决这个问题大约6个月。

Another workaround: You can use a smaller-ish tablet port in the GUI to get a really rough idea of what you are working with. 另一种解决方法:您可以在GUI中使用较小的平板电脑端口来大致了解您正在使用的内容。

If your target layout is for a phone or smaller device, simply switch the preview to a larger screen size configuration. 如果您的目标布局适用于手机或更小的设备,只需将预览切换为更大的屏幕尺寸配置即可。

In the upper left corner, under where it says 'Editing config: ~default', The list provides you with a number of screen sizes to target. 在左上角,在“编辑配置:〜默认”的位置下,该列表为您提供了许多要定位的屏幕尺寸。 Pick the 10.1 in version, and it will scale the preview, and will then allow you to see and work with all of the views that have scrolled off the screen. 选择10.1版本,它将缩放预览,然后允许您查看和使用已滚动屏幕的所有视图。

Cheers- 干杯-

The best way i could figure out is to give negetive top margin to the root layout that will make the rest of the content visible. 我能想出的最好的方法是给根布局提供一个新的上边距,使其余的内容可见。 This is only for dev purpose and should be removed when completed 这仅用于开发目的,应在完成后删除

I think this is an old topic but I was having the same issue. 我认为这是一个古老的话题,但我遇到了同样的问题。 I have 2 apps made from outsourcing. 我有两个外包应用程序。 when I opened each in eclipse one would show the full contents of the scrollview and one was clipped off. 当我在日食中打开每个时,会显示滚动视图的全部内容,其中一个被剪掉。 After numerous google searches nothing came up as a solution. 在众多谷歌搜索后,没有任何解决方案。 I just happen to look and saw the app that is clipped was android version 1.6 and the app that shows everything like i wanted it to so I can use the graphical layout for a scrollview was android verion 2.1. 我只是碰巧看,并看到被剪辑的应用程序是Android版本1.6和应用程序,显示所有我喜欢它所以我可以使用图形布局的scrollview是android verion 2.1。

So i changed the one app to version 2.1 and it fixed it. 所以我将一个应用程序更改为2.1版并修复了它。 noone seemed to address that. 似乎没有人解决这个问题。 so for me the fix was make sure the android version you are building for is 2.1. 所以对我来说,修复是确保你正在构建的Android版本是2.1。 you can always change it back to 1.6 compatable after you are done designing. 完成设计后,您可以随时将其更改为1.6兼容。

Hope this helps 希望这可以帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM