
android自定义控件
salmon_zhang
android应用开发
展开
-
自定义控件——轮播广告条
1. 效果图 2. 布局文件 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <android....原创 2020-03-29 23:21:57 · 281 阅读 · 0 评论 -
自定义控件——旋转菜单
1. 效果图 2. 布局文件 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <!--这里有个坑...原创 2020-03-27 22:07:38 · 663 阅读 · 0 评论 -
自定义DrawableTextView——实现TextView左上右下的点击监听
在Android开发中我们经常遇到TextView左上右下有图片的UI布局情形,并且各个图片点击后都要做相应的逻辑操作,这种情况下我们首先想到的是利用线性布局或相对布局去排版,然后给每个图片设置id,再在代码中去获取对应的控件,最后再设置相应的点击事件。这是最常用、最普遍的做法,也比较简单通俗易懂。但是这样写的弊端就是在XML布局文件中代码显得很臃肿,阅读性较差。原创 2017-07-14 00:06:07 · 1024 阅读 · 2 评论