【发布时间】:2017-01-04 18:02:26
【问题描述】:
我有一个xml布局文件,如下图
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/homeCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".MainActivitys.ViewPager.Fragments.Home">
<com.yalantis.phoenix.PullToRefreshView
android:id="@+id/pull_to_refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v7.widget.RecyclerView
android:id="@+id/fragment_dashboard_recycler"
android:layout_width="match_parent"
android:layout_height="match_parent">
</android.support.v7.widget.RecyclerView>
</com.yalantis.phoenix.PullToRefreshView>
</android.support.design.widget.CoordinatorLayout>
我想以编程方式将视图添加到 pulltorefresh 的容器,我已将其添加到我的协调器中,如下所示但我不知道如何将其添加到我的 pulltorefresh 任何想法?
CoordinatorLayout coordinatorLayout=(CoordinatorLayout)view.findViewById(R.id.homeCoordinatorLayout);
ImageView imageView=new ImageView(getActivity());
imageView.setImageResource(R.drawable.ufo);
【问题讨论】:
标签: android xml view android-coordinatorlayout