AlertDialog.Builder builder;
float density = mContext.getResources().getDisplayMetrics().density;
builder = new AlertDialog.Builder(mContext);
builder.setSingleChoiceItems(mAdapter, mSelectedIndex, itemClickListener);
mDialog = builder.create();
mDialog.setCanceledOnTouchOutside(true);
mDialog.requestWindowFeature(Window.FEATURE_NO_TITLE);//|Window.FEATURE_ACTION_BAR_OVERLAY);
mDialog.show();
WindowManager.LayoutParams windowParam = mDialog.getWindow().getAttributes();
windowParam.gravity = Gravity.TOP | Gravity.LEFT;
windowParam.x = -(int)(11*density);
windowParam.y = getBottom()-(int)(8*density);
windowParam.width = getWidth()+(int)(35*density);
windowParam.flags = WindowManager.LayoutParams.FLAG_LAYOUT_NO_LIMITS; // FLAG_LAYOUT_NO_LIMITS is important set for zero left position.
mDialog.getWindow().setAttributes(windowParam);
'programmer > android' 카테고리의 다른 글
seekbar progress 위치에 value 표시 (0) | 2013.06.25 |
---|---|
android custom actionbar (0) | 2013.06.22 |
Using EditText (0) | 2013.06.14 |
gridview spacing (0) | 2013.06.11 |
clickable view highlight setting (0) | 2013.06.11 |