2013-07-27 38 views
0

我正在使用Eclipse。我无法将任何东西拖放到我的xml文件的图形界面中。
当我拖动任何东西像一个按钮或文本视图时,它只是显示位置虚线块,只是卡在那里。我无法将任何东西拖放到Android中的布局图形界面

<?xml version="1.0" encoding="utf-8"?> 
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent"> 

    <TextView 
    android:id="@+id/textView1" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="32dp" 
    android:layout_marginTop="88dp" 
    android:text="text" 
    android:textAppearance="?android:attr/textAppearanceMedium" /> 

    <TextView 
    android:id="@+id/textView2" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="32dp" 
    android:layout_marginTop="120dp" 
    android:text="text" 
    android:textAppearance="?android:attr/textAppearanceMedium" /> 

<TextView 
    android:id="@+id/textView3" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:layout_marginLeft="32dp" 
    android:layout_marginTop="160dp" 
    android:text="Type your secret password" 
    android:textAppearance="?android:attr/textAppearanceLarge" /> 

</RelativeLayout> 
+0

我觉得Android Eclipse中的XML文件经常会出现小故障。我最好的建议(当没有明显的原因存在问题时)是从零开始创建一个新的XML文件,甚至可以使用复制+粘贴。反正你只有4个TextView。 –

回答

0

我只是复制并粘贴代码为RelativeLayout文件我只是在Eclipse上完成的,它似乎是工作的罚款。你有没有试过玩弄TextViews的高度和宽度,或者添加背景图片到按钮来尝试和更容易找到它们? wrap_content可能会使它太小。如果这是您第一次使用Android布局,我会推荐使用LinearLayoutRelativeLayout可能很难并且很难使用,即使对于更有经验的程序员也是如此。

相关问题