findviewbyid

    2熱度

    2回答

    我有滾動查看頭和列表視圖Body.So我要刷卡滾動視圖親語法上的列表swipe.so在我當前的代碼我得到滾動視圖的ID,其中i需要使用我可以調用的組件,scrollview.scrollTo();方法。 render() { return ( <View style={styles.container}> <View style={styles.scroll

    1熱度

    1回答

    我有textview和edittext在每個佈局重複,所以我使用包括標籤,以避免重複。 <ScrollView android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/linearLayout2" android:o

    -2熱度

    2回答

    我看StackOverflow上的其他問題與片段設置OnClickListener設置OnClickListener,我嘗試了不同的解決方案,並沒有奏效。所有說我應該設置getActivity(),一個片段活動,但它不起作用。那麼如何在片段中設置OnClickListener?

    3熱度

    2回答

    我已經用Butterknife庫成功替換findViewByIds。 不幸的是,一個問題已經發生: final Button btnPopup = (Button) popupView.findViewById(R.id.btn_popup); //popupView.findViewById(...) problem!!! 我怎樣才能改變這一行代碼在Butterknife:作爲Butterk

    -1熱度

    3回答

    我有一個單選按鈕單選按鈕組在一個XML文件: <?xml version="1.0" encoding="utf-8"?> <RadioGroup xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height

    -1熱度

    2回答

    public class fingerp extends Fragment { @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflate

    1熱度

    1回答

    我在Android 4.4.4/4.4.2/5.0.2中使用了findViewById()。 但4.4.4只有錯誤'NullpointException'。 這是我在MainActivity中的代碼。 FrameLayout fl = (FrameLayout) this.findViewById(Util.StringToResourceID(this, "id", "main_map_fl")

    0熱度

    1回答

    我想從另一個xml文件(fragment_friends.xml)中獲取列表視圖id,同時我處於activity_main.xml佈局中。我嘗試了2種方法,但它們工作不正常。 下面的代碼會導致應用程序馬上崩潰,因爲我想獲得的是不在這個佈局(activity_main)存在一個id 原始代碼 ListView friendList = (ListView) findViewById(R.id.fri

    0熱度

    2回答

    在我的應用程序中,我有同一個片段的多個實例,Activity_Fragment,顯示在LinearLayout中。在每個片段中,有一個activity_text textview和一個edit_button。當按下按鈕時,它應該改變同一片段中的文本視圖的文本。但是,添加片段的多個實例時,任何片段中的任何edit_button只會更改添加到LinearLayout的第一個片段中的activity_t

    -1熱度

    2回答

    是否存在特定方式或特定時刻,我可以從MainActivity中檢索片段中的視圖,確保元素已經初始化? 當然我用findViewById()方法在我的MainActivity但如果該片段尚未初始化它返回null,所以我試着打電話給MainActivity的初始化方法與onStart()片段方法廣播,應用程序啓動時它可以工作,但是當屏幕出現旋轉時,初始化方法將返回null,並且應用程序會以NullPo