AlertDialog의 SeekBar를 넣고 세로로 표시하고 싶습니다.

조회수 1132회
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="horizontal"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    <SeekBar
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:id="@+id/seekBar1"
        android:max="100"
        android:rotation="270" />
</LinearLayout>
       private static void _EBL1_Adjust_Button_Click(object sender, EventArgs e)
        {
            //_EBL1_SeekBar.Visibility = ViewStates.Visible;
            RadarDispActivity._Adpater_Menu.Visibility = ViewStates.Invisible;

            ShowDialog();

            _Handler = GetHandler(AbstractDataInterface.IDX_PROCS_DISP_DATA);
            _Message = _Handler.ObtainMessage();
            //_Handler.SendEmptyMessageDelayed(0, 3000);
            _Message.What = Fec.Test.RadarCmdMessage.MsgOthers.Req.EBL1_Adjust;
            _Handler.SendMessage(_Message);
        }

        private static void ShowDialog()    
        {
            AlertDialog.Builder popDialog = new AlertDialog.Builder(RadarDispActivity.instance);
            LayoutInflater wwwwq = (LayoutInflater)RadarDispActivity.instance.GetSystemService(Context.LayoutInflaterService);
            View layout = wwwwq.Inflate(Resource.Layout.SeekBar_Dialog_Layout, null);
            SeekBar _ssseekbar = (SeekBar)layout.FindViewById(Resource.Id.seekBar1);

            popDialog.SetView(_ssseekbar);

            _ssseekbar.ProgressChanged += (a, b) =>
            {
                //_Data_Edit.PutInt("EBL1_1SeekBar2", b.Progress).Apply();


                //_Handler = GetHandler(AbstractDataInterface.IDX_PROCS_DISP_DATA);
                //_Message = _Handler.ObtainMessage();
                ////_Handler.SendEmptyMessageDelayed(0, 3000);
                //_Message.What = Fec.Test.RadarCmdMessage.MsgOthers.Req.EBL1_Adjust;
                //_Message.Obj = b.Progress;
                //_Message.Arg1 = _EBL1_Arg1;
                //_Handler.SendMessage(_Message);


                //_EBL1_Arg1 = 0;
            };


            Dialog dialog = popDialog.Create();
            //popDialog.Create();

            WindowManagerLayoutParams lp = new WindowManagerLayoutParams();
            lp.CopyFrom(dialog.Window.Attributes);
            lp.X = 512;
            lp.Width = 100;
            lp.Height = 500;

            ((ViewGroup)_ssseekbar.Parent).RemoveView(_ssseekbar);
            dialog.Show();
            Window window = dialog.Window;
            window.Attributes = lp;

            //AlertDialog.Builder _Bulider = new AlertDialog.Builder(Application.Context);
            //LayoutInflater inflater = (LayoutInflater)Application.Context.GetSystemService(Context.LayoutInflaterService);
            //View layout = inflater.Inflate(Resource.Layout.SeekBar_Dialog_Layout, null);

            //AlertDialog dialog = _Bulider.Create();
            //dialog.Show();

            //_VRM1_SeekBar = (SeekBar)layout.FindViewById(Resource.Id.seekBar1);

        }

요런 버튼을 누르면 AlertDialog에 SeekBar를 세로로 띄우고 싶은데 Rotation 으로 270도 돌려주고 하게 되면

이미지

요 모양 처럼 저렇게 조금하게 나옵니다.. 이걸 Height 를 길게 늘릴 방법이 없을까요?

  • (•́ ✖ •̀)
    알 수 없는 사용자

1 답변

  • SeekBar의 layout_width를 match_parent로 layout_height을 wrap_content로 바꿔서 실행해보시길 바랍니다.

    AlertDialog의 크기를 전체적으로 크게 하시려면 AlertDialog의 테마를 수정해서 적용해보세요.

    AlertDialog에 복잡한 로직이 들어간다면 alertDialog 보다는 DialogFragment를 사용해보세요.

    • (•́ ✖ •̀)
      알 수 없는 사용자

답변을 하려면 로그인이 필요합니다.

프로그래머스 커뮤니티는 개발자들을 위한 Q&A 서비스입니다. 로그인해야 답변을 작성하실 수 있습니다.

(ಠ_ಠ)
(ಠ‿ಠ)