Wie machen Sie Hintergrund Schatten von benutzerdefinierten app.Dialog
dunkler?Machen Sie app.Dialog Schatten dunkler
Erwartung:
Reality:
Was ich versucht:
1) MyDialog dialog = new MyDialog (mContext); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK)); dialog.show();
2) MyDialog dialog = new MyDialog (mContext, R.style.NewDialog); dialog.getWindow().setBackgroundDrawable(new ColorDrawable(Color.BLACK)); dialog.show();
wo R.style.NewDialog
.
<!-- This style removes shadow but I need to make it darker.-->
<!-- Don't know which parameter needed to change for that-->
<style name="NewDialog">
<item name="android:windowFrame">@null</item>
<item name="android:windowBackground">@android:color/transparent</item>
<item name="android:windowIsFloating">true</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowTitleStyle">@null</item>
<item name="android:windowAnimationStyle">@android:style/Animation.Dialog</item>
<item name="android:windowSoftInputMode">stateUnspecified|adjustPan</item>
<item name="android:backgroundDimEnabled">false</item>
<item name="android:background">@android:color/transparent</item>
</style>
Keine Änderungen arbeiten. Scheint wie das gleiche wie in 1) 'dialog.getWindow(). SetBackgroundDrawable (neue ColorDrawable (Color.BLACK));' – AnZ
Wie zeige ich diesen Dialog an? – AnZ
AlertFragment alertDFragment = new AlertDFragment(); newFragment.show (getFragmentManager(), "Dialog"); –