में कस्टम संवाद की ऊंचाई बदलें मैंने एक कस्टम संवाद बनाया है, कोड नीचे है। समस्या यह है कि, संवाद की ऊंचाई wrap_content बन रही है, यानी यह xml में जो ऊंचाई मैं उल्लेख करता हूं उससे स्वतंत्र है। मैंने अन्य प्रश्नों की जांच की है, वे मेरी मदद नहीं करते हैं।डायलॉग फ्रैगमेंट
public class PointsDialogFragment extends DialogFragment{
private static final String TAG = PointsDialogFragment.class.getSimpleName();
public static PointsDialogFragment newInstance(){
PointsDialogFragment pdf = new PointsDialogFragment();
Bundle newBundle = new Bundle();
pdf.setArguments(newBundle);
return pdf;
}
private View mRoot;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
getDialog().requestWindowFeature(STYLE_NO_TITLE);
mRoot = inflater.inflate(R.layout.fragment_points_dialog, null);
return mRoot;
}
}
और fragment_points_dialog.xml के लिए एक्सएमएल
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="313dp"
android:layout_width="fill_parent"
android:background="@color/green_gradient_start"
>
<RelativeLayout
android:layout_width="173dp"
android:layout_height="242dp"
android:background="@drawable/reward_box"
android:id="@+id/reward_box"
android:layout_alignParentLeft="true"
>
<TextView
android:layout_centerInParent="true"
style="@style/WallSectionHeading"
android:text="5"
/>
</RelativeLayout>
<RelativeLayout
android:layout_width="173dp"
android:layout_height="250dp"
android:background="@drawable/reward_mascot"
android:layout_alignParentRight="true"
>
<LinearLayout
android:id="@+id/reward_cloud"
android:layout_width="wrap_content"
android:layout_height="100dp"
android:background="@drawable/reward_cloud"
android:layout_alignParentBottom="true"
>
<TextView
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="You have gained 5 Delight Points"
android:textColor="@color/white"
android:textStyle="italic"
android:paddingLeft="15dp"
android:paddingRight="10dp"
/>
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
मैं इस तरह संवाद दिखा रहा है ..
PointsDialogFragment pdf = PointsDialogFragment.newInstance();
pdf.show(getFragmentManager(), "dialog");
मैं एक तरह से पता है कि चाहते हैं मैं की ऊंचाई को बदल सकते हैं संवाद खंड में संवाद के साथ संवाद।
mRoot = inflater.inflate (R.layout.fragment_points_dialog, कंटेनर); क्या यह जवाब सही है ??? – Ads