android-组件
sar1618
这个作者很懒,什么都没留下…
展开
-
用于其它控件显示隐藏与MediaController保持同步
class ObserveVisibleMediaController(context: Context) : MediaController(context) { override fun show() { super.show() onVisibleChangeListener?.onShow() } override fun hide() { super.hide() onVisibleChangeListen.原创 2021-11-18 17:43:27 · 317 阅读 · 0 评论 -
removeView后仍然报未remove异常
xml布局文件中使用了android:animateLayoutChanges="true"导致代码中parent removeView后child的parent不能及时变成null,从而在其他地方add这个child还是会报异常,如果这个属性并不是很重要最简单的解决办法就是去掉这个。 ...原创 2021-09-07 13:44:34 · 373 阅读 · 0 评论 -
android Switch
<Switch android:layout_width="wrap_content" android:layout_height="wrap_content" android:thumb="@drawable/switch_thumb" android:track="@drawable/selector_switch_track" /> switch_thumb.xml <?xml version="1.0" encoding="utf-8"?&g.原创 2021-07-19 17:23:49 · 125 阅读 · 3 评论 -
android 自定义简单时钟
attrs定义如下 <?xml version="1.0" encoding="utf-8"?> <resources> <declare-styleable name="XTClockView"> <attr name="pointer_color" format="color" /> <attr name="scale_color" format="color" /> <attr n原创 2021-02-28 14:06:28 · 382 阅读 · 1 评论 -
Application在不能使用getApplicationContext()方法下的实例获取
private static IDamApplication mainApp;public IDamApplication() { mainApp = this; }public static IDamApplication getInstance() { return mainApp; } 或者是private static IDamApplication mainApp;@Ove原创 2017-02-08 10:20:46 · 2905 阅读 · 0 评论 -
android 输入法弹出 标题栏不被顶出去
方案一:使用scrollview包裹并设置属性 android:fadeScrollbars="true" android:fillViewport="true" 不要使用android:scrollbars="none" 如果不需要显示滚动条,在代码里面设置 ScrollView sc = (ScrollView) view.findViewByI...转载 2018-08-02 16:19:39 · 2764 阅读 · 4 评论