xamarin android TextView跑马灯效果和EditText焦点冲突的问题
来源:互联网 发布:ipad软件哪里下载 编辑:程序博客网 时间:2024/05/24 00:52
在实现androd textview跑马灯效果的时候,和EditText的焦点事件冲突了,一旦EditText获取焦点以后,textview文本就不再滚动。网上查资料,大部分的解决方法都是重写TextView,然后重写OnFocusChanged事件和IsFocused()方法,让IsFocused方法中返回true.但是实际应用之后发现,在xamarin中,isFocused根本不是一个方法而是一个属性。所以重写这个属性之后一直报错。这里是解决办法。textview还是正常设置就可以了。
public class MarqueeText : TextView { public MarqueeText(Context context) : base(context) { } public MarqueeText(Context context, IAttributeSet attrs) : base(context, attrs) { } public MarqueeText(Context context, IAttributeSet attrs, int defStyle) : base(context, attrs, defStyle) { } protected override void OnFocusChanged(bool gainFocus, FocusSearchDirection direction, Android.Graphics.Rect previouslyFocusedRect) { base.OnFocusChanged(true, direction, previouslyFocusedRect); } public bool IsFocused { get { return true; } } }
0 0
- xamarin android TextView跑马灯效果和EditText焦点冲突的问题
- Android TextView 跑马灯效果和 EditText 冲突
- TextView的跑马灯效果,还有焦点问题
- 跑马灯效果影响EditText的焦点
- Android 跑马灯效果与EditText冲突
- 【Android】不依赖焦点和选中的TextView跑马灯【2】
- 【Android】不依赖焦点和选中的TextView跑马灯【2】
- 【Android】不依赖焦点和选中的TextView跑马灯
- Android GridView和EditText焦点冲突问题
- android tv跑马灯效果与HorizontalScrollView焦点冲突解决方案
- 不持有焦点的跑马灯效果TextView
- Android中TextView不获取焦点可以实现跑马灯的效果
- Android:TextView不获取焦点可以实现跑马灯的效果
- Android中TextView不获取焦点可以实现跑马灯的效果
- Android中TextView不获取焦点可以实现跑马灯的效果
- Android自定义不需要焦点的TextView以实现跑马灯效果
- textview 无需焦点无限跑马灯效果
- Android 跑马灯效果实现的两种方式,解决和viewpager的冲突问题
- H5、React Native、Native应用对比分析
- CentOS 手动增加、删除swap区
- 润乾报表新功能–导出excel支持锁定表头
- 【IOS学习】网络请求中的cookie
- 微信小程序 wx.uploadFile 的编码坑
- xamarin android TextView跑马灯效果和EditText焦点冲突的问题
- 第十四周6
- 【Java学习之代码学习】 Prog10_公约数和公倍数问题
- 文本分类中语料库的获取——对搜狗语料库进行想要格式的获取
- Android操作系统11种传感器介绍
- Android-自定义控件
- c语言实现增删双向链表
- 【Java学习之代码学习】 Prog21_回文数问题
- HTML标签里的p标签包p标签出现的问题