2011-11-26 62 views
0

我想开发一个块表示与输入和输出。 主要IDEIA是:黑色屏幕使用ScrollView + RelativeLayout和一个costum视图(就像一个画布)

  1. 用户可以增加输出/输入
  2. 用户可以编辑。OUPUTS /输入添加

所以我们有这样的事情:

enter image description here

我设法构建了一个动态画布,当用户按下其中一个按钮(绘制区域增长)时,画布会发生变化。

当画布比屏幕高度大时,问题就开始了。其结果是这样的:

enter image description here

请注意,我有一个滚动视图。但是,似乎scrollview将一切都变成黑色。我的XML文件是这样的:

<ScrollView 
    xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:fillViewport="true"> 
    <RelativeLayout 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content"> 

     <pt.mypackage.BlockCanvas 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content" /> 

     <EditText 
      ... /> 

     <Button 
      ... />  

     <Button 
      ... />  

    </RelativeLayout> 
</ScrollView> 
+1

你能详细说明什么是实际问题吗? –

+0

如果你想要一个问题,我可以这样说:为什么黑屏出现?我知道它只在画布变得比屏幕高度大时出现。但为什么? –

回答

0

我经历过类似的东西,您的问题,我将结束了滚动视图与RelativeLayout和使用android:layout_allignParentTop="true"解决它。如果不工作尝试添加空视图(没有高度只是宽度),将作为您的ScrollView将放置在下面的锚点。我希望这是有道理和工程

相关问题