C# Android布局问题。。不知道如何调试

C# Android布局问题。。不知道如何调试,c#,android,visual-studio-2010,android-layout,xamarin.android,C#,Android,Visual Studio 2010,Android Layout,Xamarin.android,更新 对数输出 我的应用程序在调试器中停止,然后在此行上崩溃,但这很奇怪,因为它没有错误信息,只有一个绿色箭头,就像这样 如果您能了解箭头的一般含义,我们将不胜感激 这是学生名单 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_paren

更新

对数输出

我的应用程序在调试器中停止,然后在此行上崩溃,但这很奇怪,因为它没有错误信息,只有一个绿色箭头,就像这样

如果您能了解箭头的一般含义,我们将不胜感激

这是学生名单

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    >
  <TextView  
    android:id="@+id/studentHeader"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:padding="10dp"
    android:textSize="16sp"
    android:text="@string/StudentListHeader"
    android:layout_alignParentTop="true"
    />
  <EditText
    android:id="@+id/studentSearch"
    android:layout_width="fill_parent"
    android:layout_below="@id/studentHeader"
    android:padding="10dp"
    android:textSize="12sp"
    android:editable="true"
    android:hint="@string/StudentFilterPlaceholder"
    />
  <ListView
      android:id="@+id/studentListView"
      android:layout_width="fill_parent"
      android:layout_height="wrap_content"
      android:layout_below="@id/studentSearch"
      android:padding="10dp"
    />
</RelativeLayout>


问题几乎肯定出在我的XML中的某个地方,当我用一个文本视图替换布局内容并设置文本时,它工作正常。

挂起是什么意思?比如,在调试器中停止?撞车


这不应该是
setContentView()
,而不是用大写字母S设置吗?可能这就是问题所在。

问题在于布局文件中的studentSearch EditText元素没有指定
布局高度属性。一旦您在中添加,问题应该消失(我也在本地验证了这一点)。错误消息和伴随的stacktrace也将通过以下方式显示:


在调试器中停止,冻结Visual Studio,然后在我的开发设备上崩溃。在原问题中作了更具体的说明。实际上,
SetContentView()
在C#中大写,我使用的是Android的Mono。设备上logcat中有堆栈跟踪吗?我不使用VS,但当我在Eclipse中调试并抛出异常时,它通常会在异常发生之前进入调试器。他使用的是MonoDroid,所以是.Net和Visual Studio,而不是Java。
adb logcat
在命令窗口中应该为您获取跟踪。修复了该问题。仍然做同样的事情,logcat输出在这里-->那里没有太多,但是看起来调试器在启动时遇到了一些问题。我建议尝试一个干净的构建并再次启动,看看它是否有帮助。从任务管理器中删除adb.exe实例可能也会有所帮助。另一件值得一提的事情是,您可能希望尝试在不进行调试的情况下运行应用程序。Android版Mono中的调试器有时会非常慢,因此在不需要的时候不使用调试器可以获得更好的性能。
I/dalvikvm( 2083): Ljava/lang/RuntimeException;: Binary XML file line #14: You must supply a layout_height attribute.