ダイアログで入力画面を表示させるのですが、その中にあるeditTextにライン制限をつけるにはどうしたらよいのでしょうか?
c#
1 2 notebutton.Click += (_, __) => 3 { 4 var layout = new LinearLayout(this) { Orientation = Orientation.Vertical }; 5 layout.SetGravity(GravityFlags.Left); 6 var notename = new EditText(this); 7 notename.MaxLines = 1;//エラー 8 layout.AddView(new TextView(this) { Text = "ノート名" }); 9 layout.AddView(notename); 10 11 var dlg = new AlertDialog.Builder(this); 12 dlg.SetTitle("ノートの名前を入力してください。"); 13 dlg.SetView(layout); //ビューを指定 14 15 dlg.SetPositiveButton("OK", (s, a) => Toast.MakeText(this, notename.Text, ToastLength.Short).Show()); 16 dlg.Create().Show(); 17 18 };
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/10/29 01:02