0
我有它显示我的日期布局,然后一些代码在LinearLayout中,像这样:删除XML组件而不是隐藏?
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:padding="16dp">
<TextView
android:id="@+id/message_date"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="@color/grey_500"
android:textSize="16sp"
android:text="wefwefwef"
android:textStyle="normal"
/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/textView"
android:id="@+id/orange_message"
android:layout_alignParentLeft="true"
android:layout_alignParentStart="true"
android:textColor="#000000"
android:textSize="20sp"
android:textStyle="bold"
/>
</LinearLayout>
基本上,我想在我的Java做的是隐藏的TextView MESSAGE_DATE。我目前正在使用setVisibility(View.INVISIBLE)
这可以工作,但它似乎保留了message_date的样式,因此orange_message实际上出现在视图的更下方。 是否有反正我可以设置它,因此它的行为就像message_date从来没有?
我不明白,当你使用** setVisibility(View.INVISIBLE)**万物欧凯,我的意思是_TextView_不见了。再进一步,_TextView_再次出现? – TeachMeJava 2014-09-01 13:41:15