1
どのようにプログラムでviewParentにビューを追加するのですか?私はプログラム的pulltorefreshのコンテナにビューを追加したい
<?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>
以下のように私は、XMLレイアウトファイルを持って、下図のように私は私のコーディネーターにそれを追加したが、私は追加する方法がわかりませんそれは私のpulltorefresh任意のアイデアに?
CoordinatorLayout coordinatorLayout=(CoordinatorLayout)view.findViewById(R.id.homeCoordinatorLayout);
ImageView imageView=new ImageView(getActivity());
imageView.setImageResource(R.drawable.ufo);
これは質問に対する答えを提供しません。批評をしたり、著者の説明を求めるには、投稿の下にコメントを残してください。 - [レビューから](レビュー/低品質の投稿/ 13490799) –
@SuhailMehta、Agree!時には私はシンプルになっています。 –