申明了一個屬性:private View mPassView;為什么我在handlePassEvent()方法中通過mPassView屬性調用anser_right布局不會生效? private void handlePassEvent() { mPassView = (LinearLayout)this.findViewById(R.id.pass_view); mPassView.setVisibility(View.VISIBLE);這里的調用不會出現通關界面,其它是正常的,求解xml布局應該是沒有錯誤的<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"? ? android:id="@+id/pass_view"? ? android:layout_width="match_parent"? ? android:layout_height="match_parent"? ? android:background="#cc000000"? ? android:gravity="center"? ? android:orientation="vertical"?? ? android:visibility="gone" >? ? <LinearLayout? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:gravity="center" >? ? ? ? <ImageView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:layout_marginRight="5dp"? ? ? ? ? ? android:src="@drawable/index_medal" />? ? ? ? <TextView? ? ? ? ? ? android:id="@+id/text_main_achievement"? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:text="您已擊敗"? ? ? ? ? ? android:textColor="@color/white"? ? ? ? ? ? android:textSize="18sp" />? ? </LinearLayout>? ? <TextView? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_marginTop="40dp"? ? ? ? android:text="答案正確"? ? ? ? android:textColor="@color/white"? ? ? ? android:textSize="35sp" />? ? <FrameLayout? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_marginBottom="40dp"? ? ? ? android:layout_marginTop="40dp" >? ? ? ? <ImageView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:src="@drawable/game_level_title" />? ? ? ? <TextView? ? ? ? ? ? android:id="@+id/text_current_stage_pass"? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:layout_gravity="center"? ? ? ? ? ? android:text="1"? ? ? ? ? ? android:textColor="@color/white"? ? ? ? ? ? android:textSize="20sp"? ? ? ? ? ? android:textStyle="bold" />? ? </FrameLayout>? ? <TextView? ? ? ? android:id="@+id/text_current_song_name_pass"? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_marginBottom="20dp"? ? ? ? android:text="同桌的你"? ? ? ? android:textColor="@color/white"? ? ? ? android:textSize="20sp" />? ? <LinearLayout? ? ? ? android:layout_width="match_parent"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_marginBottom="20dp"? ? ? ? android:gravity="center" >? ? ? ? <TextView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:text="獎勵:"? ? ? ? ? ? android:textColor="@color/white"? ? ? ? ? ? android:textSize="20sp" />? ? ? ? <ImageView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:src="@drawable/game_coin_icon" />? ? ? ? <TextView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:text="*"? ? ? ? ? ? android:textColor="@color/white"? ? ? ? ? ? android:textSize="25sp" />? ? ? ? <TextView? ? ? ? ? ? android:layout_width="wrap_content"? ? ? ? ? ? android:layout_height="wrap_content"? ? ? ? ? ? android:text="3"? ? ? ? ? ? android:textColor="@color/white"? ? ? ? ? ? android:textSize="25sp" />? ? </LinearLayout>? ? <ImageButton? ? ? ? android:id="@+id/btn_next"? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:layout_marginBottom="20dp"? ? ? ? android:background="@drawable/next_button_icon" />? ? <ImageButton? ? ? ? android:id="@+id/btn_share"? ? ? ? android:layout_width="wrap_content"? ? ? ? android:layout_height="wrap_content"? ? ? ? android:background="@drawable/weixin_button_icon" /></LinearLayout>
各位大蝦,緊急求助
andriod_2014
2015-01-05 11:15:30