【发布时间】:2013-09-12 22:03:07
【问题描述】:
好的,所以我现在对 google 上的这个话题感到非常沮丧,因为没有人提出正确的问题。
我的 windows phone 8 应用程序上有一个文本框。
现在,一旦我单击该文本框,就会弹出 SIP 键盘(我得到的那部分,是由操作系统完成的)。
现在我想要做的是,一旦我点击了我不想打开 SIP 的文本框,因为它会导航到另一个页面,但我不能将其设为按钮,因为用户可以在一旦他们从其他页面选择数据,文本框。
现在 Windows Phone 文本框上是否有一个属性可以限制键盘弹出?
我不能让它只读,因为那样看起来不好,然后用户会看到文本框不可编辑。
任何链接、代码或以前的问题将不胜感激!
编辑:我也尝试将焦点设置在其他一些控件上,但速度不够快,所以键盘也会弹出!,
我没有物理控件,我的控件都是动态的,取决于发送的内容 网络服务:
这是一个示例! :
else if (field.CtlType == WFCoreLib.DataModels.Generic.FieldAttributes.ControlType.ctFinder)
{
TextBox txtFindercontent = new TextBox();
txtFindercontent.HorizontalAlignment = System.Windows.HorizontalAlignment.Right;
//txtFindercontent.Text = field.FieldDescLoc.ToString();
txtFindercontent.SetValue(Grid.ColumnProperty, 1);
txtFindercontent.SetValue(Grid.RowProperty, count);
txtFindercontent.Width = 220;
txtFindercontent.FontSize = 20;
txtFindercontent.TextWrapping = TextWrapping.Wrap;
txtFindercontent.IsHitTestVisible = true;
//txtFindercontent.LostFocus += txtcontent_LostFocus;
txtFindercontent.Name = "fndDescription" + count.ToString();
txtFindercontent.Tag = field.MaxValue + "," + field.FieldDescLoc + "," + field.IsRequired + "," + count + "," + blockindex + "," + field.FieldID + "," + field.ColumnName + "," + field.FieldCode;
txtFindercontent.GotFocus += txtFindercontent_GotFocus;
if (field.FieldType == WFCoreLib.DataModels.Generic.FieldAttributes.DataType.dtInteger || field.FieldType == WFCoreLib.DataModels.Generic.FieldAttributes.DataType.dtDouble)
{
InputScope scope = new InputScope();
InputScopeName name = new InputScopeName();
name.NameValue = InputScopeNameValue.Number;
scope.Names.Add(name);
txtFindercontent.InputScope = scope;
}
PS:Apple/iPhone 文本框有一个限制键盘的属性。我希望 WP8 也有一个
问候
【问题讨论】:
-
听起来你想要一个按钮,它的文本属性绑定到你的视图模型上的一个属性?
-
基本上,是的。但是我们的应用程序需要在所有平台上看起来都一样,所以我必须使用文本框,这让我很沮丧,因为它看起来很奇怪,只要我点击控件,键盘就会弹出一秒钟然后导航。我非常想使用一个按钮,但不能
-
为什么不把按钮设置成文本框的样式呢?
-
你不能为你的只读应用自定义样式,让它看起来没问题吗?我开发了一个应用程序,它完全可以满足您的需求。我们的 TextBox 是只读的,我们将导航绑定到文本框的 Tap 事件。
标签: c# textbox windows-phone-8 keyboard