samedi 22 mars 2014

Android Activity Dialog missing button on different resolutions


Vote count:

0




I am creating an activity that is styled like a dialog. The code works great, but the dialog looks different on my Galaxy S3 than my Nexus 5. How do make sure that all resolutions will show the button?


Code:



requestWindowFeature(Window.FEATURE_LEFT_ICON);
setContentView(R.layout.widget_dialog);
setFeatureDrawableResource(Window.FEATURE_LEFT_ICON,R.drawable.icon);
//Setup Dialog Activity Parameters
this.setFinishOnTouchOutside(false);
setContentView(R.layout.widget_dialog);
LayoutParams params = getWindow().getAttributes();
params.x = -30;
params.height = 350;
params.width = 550;
params.y = -30;
getWindow().setAttributes(params);


Screenshot on my Samsung Galaxy S3 enter image description here


Screenshot on my Nexus 5 enter image description here


Notice that the button is missing.



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire