Bốn chế độ xem đang sử dụng cùng một xml. Tôi muốn hiển thị bố cục tuyến tính cho chỉ view 1
. Tôi đặt android:visibility="gone"
vào xml. Và sau đó tôi làm như sau cho view 1
-bố cục Android có chế độ hiển thị GONE
LinearLayout layone= (LinearLayout) view.findViewById(R.id.layone);
layone.setVisibility(View.VISIBLE);
Nhưng điều đó không đặt khả năng hiển thị hiển thị.
Không thể hiển thị chế độ xem sau khi được tuyên bố là GONE
trong xml?
Tôi không muốn chuyện logic bởi chỉ cần làm,
layone.setVisibility(View.GONE);
trong mỗi ba quan điểm trừ điểm 1.
Ý tưởng hay ý kiến?
UPDATE:
xml My -
<TextView
android:id="@+id/layone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Previous Page"
android:textColor="#000000"
android:textSize="16dp"
android:paddingLeft="10dp"
android:layout_marginTop="10dp"
android:visibility="gone" />
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="50dp"
android:orientation="horizontal"
android:padding="10dp"
android:gravity="center_vertical"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:tag="PrevEntries"
android:id="@+id/laytwo"
android:layout_marginTop="10dp"
android:background="@layout/roundedtext"
android:visibility="gone" >
<TextView
android:id="@+id/laythree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Previous Page"
android:textColor="#000000"
android:textSize="18dp"
android:gravity="center"
android:textStyle="bold" />
</LinearLayout>
Xem cập nhật của tôi với xml. Tôi không muốn hiển thị toàn bộ cái này theo mặc định. Tôi chỉ muốn nó được thể hiện trong quan điểm của tôi 1. –