请看代码。如果我删除我的添加..代码工作正常我正在尝试在线性布局下添加一个文本字段..请参阅代码中的注释
这是工作代码
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:orientation = "vertical">
<FrameLayout android:id="@+id/RootFrameLayout"
android:layout_width = "match_parent"
android:layout_height = "42dip">
<TextView
android:id="@+id/RootTextView"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:text="TextView"
android:textColor="@color/white"
android:textSize="12sp"
android:ellipsize="end"
android:scrollHorizontally="true"
android:lines="2"/>
<!--If we insert the New code then not working (new code find below)-->
</FrameLayout>
<FrameLayout
android:id="@+id/RootFrameLayout2"
android:layout_width = "match_parent"
android:layout_height = "match_parent"
android:background = "@drawable/pink.bg"
adroid:layout_gravity = "top" >
<ProgressBar
android:id="@+id/progressbar1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:background = "@drawable/pink.bg"
adroid:layout_gravity = "center" />
</FrameLayout>
</LinearLayout>
新代码:如果我们在工作代码中添加以下代码。应用程序是强制关闭。
<LinearLayout
android:id="@+id/Linearlayout1"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content"
android:visiblity ="invisible">
<TextView
android:id="@+id/LinearTextView"
android:layout_width = "wrap_content"
android:layout_height = "wrap_content" />
</LinearLayout>