
false if the element should receive input; true if element should not receive input and should,instead,pass inputs to the element below. Default is false.
我想要的是,不允许Entry字段接收来自用户的输入.
inputtransparent = true在iOS中运行良好但在AndroID中不起作用,它仍然允许用户提供输入.
我尝试过IsEnabled = false,但这会改变我的Entry字段的外观,我不希望这样.
这是某种错误吗?
解决方法 inputtransparent不适用于AndroID.我为StackLayout创建了简单的渲染:在PCL项目中:
public class StackLayoutAdd :StackLayout{} 在AndroID项目中:
[assembly: ExportRenderer(typeof(StackLayoutAdd),typeof(StackLayoutAddCustom))] .....public class StackLayoutAddCustom : VisualElementRenderer<StackLayout>{ public overrIDe bool dispatchtouchEvent(MotionEvent e) { base.dispatchtouchEvent(e); return !Element.inputtransparent; }} 我在我的xaml中使用它:
<StackLayoutAddCustom inputtransparent={Binding IsReadonly}> <Editor /> .... </StackLayoutAddCustom> 这是儿童控制的工作.
总结以上是内存溢出为你收集整理的InputTransparent = true在Xamarin Forms Android中不起作用全部内容,希望文章能够帮你解决InputTransparent = true在Xamarin Forms Android中不起作用所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)