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