【发布时间】:2013-03-21 22:32:21
【问题描述】:
当文本视图位于右侧时,我在它附近使用微调器和文本视图,但当我切换它们时,应用程序在 java 类的下面一行中崩溃
spinner= (Spinner) findViewById(R.id.spinner)
我的 xml 代码是
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginTop="5dp"
android:orientation="horizontal"
android:weightSum="100" >
<TextView
android:id="@+id/tv"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:layout_weight="70"
android:text="0"
android:textSize="30sp" />
<Spinner
android:id="@+id/spinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:layout_marginTop="5dp"
android:layout_weight="30" />
</LinearLayout>
现在当我把微调器放在首位时,它工作正常
【问题讨论】:
-
仅发布发生错误的行是不够的...发布实际错误。