1 <?XML version= "1.0" encoding= "Utf-8"?>2 <Shapexmlns:android= "Http://schemas.android.com/apk/res/android" >4 <SolidAndroid:color= "@color/black" />6 <CornersAndroid:radius= "10DP" />8 </Shape>
1 <?XML version= "1.0" encoding= "Utf-8"?>2 <LinearLayoutxmlns:android= "Http://schemas.android.com/apk/res/android"3 Android:id= "@+id/layout_my_dialog_cahce"4 Android:layout_width= "Wrap_content"5 Android:layout_height= "Wrap_content"6 Android:paddingtop= "30DP"7 Android:paddingbottom= "20DP"8 Android:paddingleft= "70DP"9 Android:paddingright= "70DP"Ten Android:background= "@drawable/my_dialog_cache_bg" One android:gravity= "Center" A android:orientation= "vertical" > - <ImageView the android:src= "@drawable/my_center_dialog_ok" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" /> + <TextView - Android:text= "Clear Success" + Android:textcolor= "@color/white2" A android:textsize= "16SP" at Android:layout_margintop= "10DP" - Android:layout_width= "Wrap_content" - Android:layout_height= "Wrap_content" /> - </LinearLayout>
1Toast toast =NewToast (mactivity);2View view = Layoutinflater.from (mactivity). Inflate (R.layout.my_center_cache_dialog,NULL);3 4LinearLayout Layout_my_dialog_cahce =(linearlayout) View.findviewbyid(R.ID.LAYOUT_MY_DIALOG_CAHCE);6Layout_my_dialog_cahce.getbackground (). Setalpha (95);7 8 Toast.setview (view);TenToast.setgravity (gravity.center, 0, 0); AToast.show ();
50. Toast Custom Layout