【问题标题】:How to view all widgets in the XML Layout in Graphical view / How to Scroll the Graphical Layout in eclipse?如何在图形视图中查看 XML 布局中的所有小部件/如何在 Eclipse 中滚动图形布局?
【发布时间】:2014-07-03 11:09:16
【问题描述】:

我有一个 XML 布局,其中包含许多 textViews 和 editTexts,一个在另一个之下,例如 10 个 textViews 和 10 个 editTexts。这会自动在手机和模拟器中创建滚动视图。而在 ADT 的图形布局中,只有 4 个可见。我无法在 Eclipse 图形布局中查看剩余部分。我必须连接到模拟器才能查看设计/对齐是否符合预期。

有什么方法可以使用eclipse的图形布局功能查看所有textViews和editTexts直到最后一个?

【问题讨论】:

  • 一种选择是在图形布局中使用大设备分辨率布局。但是即使是没有滚动的最大屏幕分辨率,小部件的数量也超过了! :(

标签: android eclipse android-layout android-emulator


【解决方案1】:

我将整个子 View 放在 Scroll View 中,而不是线性布局或相对布局。 像这样

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
<LinearLayout 
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/background_color"
    android:orientation="vertical" >
   ..........
   .......... 

</LinearLayout>
</ScrollView>

这对我有用。

【讨论】:

  • 但它是否在 Eclipse 图形布局中滚动?
  • 是的,在我的情况下,它在 Eclipse 图形布局中滚动。
猜你喜欢
  • 2014-12-21
  • 2013-03-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-05-25
  • 1970-01-01
  • 2012-06-19
相关资源
最近更新 更多