我是新的android编程,我有一个问题。我使用Eclipse,我创建了一个切换按钮,但在图形布局中没有显示任何内容,它向我展示了这个“在渲染期间引发的异常:-1”。我能做什么?我在我的代码下面发布我已经使用过的代码。Android图形布局不显示切换按钮
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:padding="25dp"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<EditText
android:id="@+id/etCommands"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:hint="Type a Command"
android:password="true" />
<LinearLayout
android:weightSum="100"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:layout_weight="20"
android:id="@+id/bResults"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:text="Try Command" />
<ToggleButton
android:layout_weight="80"
android:paddingBottom="10dp"
android:checked="true"
android:id="@+id/tbPassword"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:text="ToggleButton" />
</LinearLayout>
<TextView
android:id="@+id/tvResults"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:text="invalid" />
你可以发布整个XML? – Dara 2015-02-10 16:25:48