这个xml布局文件有什么问题吗?为什么setContentView在加载此文件后失败,并且在此之后关闭应用程序
这是XML文件。奇怪的是,我的程序在执行setContentView后立即退出。logcat只显示了这一点 线程id=1线程以未捕获异常退出(组=0x417d)这个xml布局文件有什么问题吗?为什么setContentView在加载此文件后失败,并且在此之后关闭应用程序,xml,android-layout,Xml,Android Layout,这是XML文件。奇怪的是,我的程序在执行setContentView后立即退出。logcat只显示了这一点 线程id=1线程以未捕获异常退出(组=0x417d) 我发现了这个调整,它真的让人困惑,我认为eclipse至少应该有一些调试信息,因为这真的很吸引人。该问题与TextView中缺少layout_width属性有关。不确定这会导致崩溃的原因,但至少加上这一点,情况变得更糟了 <?xml version="1.0" encoding="utf-8"?> <LinearLay
我发现了这个调整,它真的让人困惑,我认为eclipse至少应该有一些调试信息,因为这真的很吸引人。该问题与TextView中缺少layout_width属性有关。不确定这会导致崩溃的原因,但至少加上这一点,情况变得更糟了
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView android:id="@+id/SpeechResult"
android:layout_height="0dp"
android:layout_weight="1"
android:background="@drawable/rounded_edge"
android:padding="6dip"
android:hint="Waht is on your mind?"/>
<ToggleButton
android:id="@+id/ToggleRecognition"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:textOff="Start"
android:textOn="Stop"
android:onClick="onToggleRecognition"/>
</LinearLayout>