开发者

Android Layout issues.. Not sure how to debug

UPDATE____

Logcat output http://pastie.org/2039452

My application is stopping in the debugger, and then crashing on this line, but it is strange because it has no error information just a green arrow like so...

Any insight on what this arrow means in general would be appreciated...

Android Layout issues.. Not sure how to debug

Here is LayoutStudentList

<?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"
    />
</Relati开发者_C百科veLayout>

The problem is almost definitely in my XML somewhere, as when I replace the layout contents with a single textview and set the text it works fine.


The problem is that the studentSearch EditText element in your layout file didn't specify a layout_height attribute. Once you add that in the problem should go away (I verified this locally as well). The error message and accompanying stacktrace would also be visible via the ADB logcat output:

I/dalvikvm( 2083): Ljava/lang/RuntimeException;: Binary XML file line #14: You must supply a layout_height attribute.


What does 'hanging' mean? Like, stopped in the debugger? Crashing?

Shouldn't that be setContentView(), not Set with a capital S? Maybe that's the problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜