Ich habe ein XML-Datei-Layout wie untenWie füge ich einem ViewParent programmatisch eine View hinzu?
<?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>
gezeigt ich einen Blick auf den Container des pulltorefresh programmatisch hinzufügen will, ich habe es meinen Koordinator hinzugefügt, wie unten gezeigt, aber ich weiß nicht, wie man hinzufügen es zu meinem pulltorefresh irgendwelche Ideen?
CoordinatorLayout coordinatorLayout=(CoordinatorLayout)view.findViewById(R.id.homeCoordinatorLayout);
ImageView imageView=new ImageView(getActivity());
imageView.setImageResource(R.drawable.ufo);
Dies bietet keine Antwort auf die Frage. Um einen Autor zu kritisieren oder um Klärung zu bitten, hinterlasse einen Kommentar unter seinem Beitrag. - [Aus Bewertung] (/ review/low-quality-posts/13490799) –
@SuhailMehta, Agree! Manchmal bin ich zu einfach. –