Reputation: 7196
i know this question was asked for aligning a dialog on the left, but here i'm using an activity with a
android:theme="@android:style/Theme.Dialog"
and the problem is that it's display at the center of the screen and i want to display on the top left corner.
is there any way to do so ?
i have tried using the android:layout_gravity="top|left"
on my concerned activity .xml but that doesn't work.
Thank you for your help
Upvotes: 3
Views: 2683
Reputation: 922
Try this on your onCreate of dialog activity
WindowManager.LayoutParams wmlp = getWindow().getAttributes();
wmlp.gravity = Gravity.TOP | Gravity.LEFT;
Hope it helps.
Upvotes: 7