CoolImageView

项目地址:HuTianQi/CoolImageView
简介:一个类似腾讯 QQ 背景图片可以上下移动的 imageview,功能比腾讯 QQ 更加强大,还支持左右移动,支持在 xml 文件中设置移动方向(注意:是背景图片的移动,不是用动画让控件移动,那太简单了)

A imageView is similar to QQ that imageView background picture can move up and down,But the function is more powerful than QQ,it also supports left and right movement

 

Dynamic effect preview (Because the gif resources are large, please wait for the resources to complete the load)

this is background picture left and right movement

this is background picture move up and down

How to use

step1: Add the following to your attrs.xml file (in res/values):

<resources><declare-styleable name="CoolImageView"><attr name="direction" format="string"/></declare-styleable>
</resources>

step2:Add the following code to the root view of your layout:

xmlns:app="http://schemas.android.com/apk/res-auto"

step3:Add the widget code in the appropriate place in your xml file, Here's a sample implementation:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"xmlns:app="http://schemas.android.com/apk/res-auto"android:id="@+id/activity_main"android:layout_width="match_parent"android:layout_height="match_parent"android:orientation="vertical"tools:context="com.example.hzhuqi.coolimagview.MainActivity"><com.example.hzhuqi.coolimagview.CoolImageViewandroid:layout_width="wrap_content"android:layout_height="300dp"android:src="@mipmap/qq"app:direction="horizontal"></com.example.hzhuqi.coolimagview.CoolImageView><com.example.hzhuqi.coolimagview.CoolImageViewandroid:layout_marginTop="@dimen/activity_vertical_margin"android:layout_width="match_parent"android:layout_height="match_parent"android:src="@mipmap/qq_"app:direction="vertical"></com.example.hzhuqi.coolimagview.CoolImageView>
</LinearLayout>

Notice:

you should set direction properties in your xml file,If you don't want to do that.You can use ordinary ImageView instead

Android一个类似腾讯 QQ 背景图片可以上下左右移动的 imageview相关推荐

  1. Android APP开发实战:界面背景图片的添加与显示

    Android App,界面UI是一个很重要的东西,如果界面好,即使简单的功能,也会让用户觉得,高端大气上档次. 开发环境:Win10 64位+Android Studio 3.5.3 界面背景图片的 ...

  2. 自定义背景android,Android自定义Button并设置不同背景图片的方法

    本文实例讲述了Android自定义Button并设置不同背景图片的方法.分享给大家供大家参考,具体如下: 1.自定义MyButton类 public class MyButton extends Bu ...

  3. [css] 如何使用css3实现一个div设置多张背景图片?

    [css] 如何使用css3实现一个div设置多张背景图片? background-image:url("1.jpg"),url("2.jpg"),url(&q ...

  4. Android中遇到button按钮设置背景图片无法显示的解决方案

    给button设置了background的属性却显示不出来 1.在图片导入时选错位置,应该选择第一个位置,如果选了第二个图片后面会有(v24)[如下图]就有可能加载不出来.  新版引入drawable ...

  5. Android中替换头像图标和背景图片

    一,修改头像图标和名称 第一步:在res下的drawable--hdpi中导入图片 第二步:在res下的androidManifest.xml中在代码中的application的icon中修改为插入图 ...

  6. android动态图片做背景,在Android上添加动态内容后,背景图片变为纯色

    我的目标是在网站内容后拥有完整的背景图片.我正在使用以下CSS实现此目的: body { background: url(../img/bg.jpg) no-repeat center center ...

  7. Android点击按键改变按键背景图片-选择器

    如下,点击drawable,点击new,再点击drawable resource file 如下,名字为btn的选择器selector,我在项目中改成了btnselector2 然后在下面输入这些代码 ...

  8. Android开发类似微信九格宫图片

    一些动态,心情,晒单都有可能用到九宫格形式显示图片 自定义控件:NineGridLayout public class NineGridLayout extends ViewGroup {/*** 图 ...

  9. android 背景切换动画效果代码,在Android应用中以模糊效果设置背景图片

    我试图使列表视图上的背景图像模糊,但是我尝试按照教程进行操作,但它不起作用.任何人都请指教,谢谢. 主要活动 public class IngredientCategoryMain extends A ...

最新文章

  1. Android高级编程(笔记)-第6章 数据存储、检索和共享--2--本地文件
  2. 基本CSS选择器,复合选择器,后代选择器
  3. matlab模拟伯努利实验,matlab仿真随机数的发生
  4. 【用研】细读7张图片,教你玩转用户调研
  5. mysql 事务权限_0428-mysql(事务、权限)
  6. 让无数人头疼的网络攻击到底是什么?究竟隐藏了哪些不为人知的秘密?
  7. c语言程序设计学到了什么,C语言程序设计入门学习六步曲
  8. 组态王bitset用法_组态王使用问题解答6
  9. 使用 Python 爬取网页数据
  10. java设置连接超时_HttpClient设置连接超时时间
  11. unzip 分包_劳务派遣第二讲一一劳务派遣和劳务分包有啥区别?
  12. 企业电子文档管理系统哪个好?怎么选?
  13. 商业智能时代,大数据分析行业前景
  14. 艾瑞报告| 中国 IoT 物联网行业研究
  15. 微信小程序因视频播放不合规问题解决
  16. jase--接口学习
  17. Android开发实现高德地图定位详解
  18. STM32 软件模拟IIC
  19. PROCESSENTRY32
  20. 四针手表指的是什么_六针手表是什么意思 六针手表全面解读

热门文章

  1. Windows让Tomcat以Apr的方式运行
  2. CoBOT助力ITSS技术要求标准制定和落地
  3. 坯子库和suapp哪个好用_关于Sketchup插件安装使用,你应该知道的那些事
  4. android 分享给好友,手机将安卓软件分享给好友的方法
  5. 计算机网络: IP地址,子网掩码,默认网关,DNS服务器详解
  6. Unity3D——学习分享(二) 给游戏对象添加材质和贴图
  7. api接口文档中的签名是什么
  8. 使用自然语言处理来检测电子邮件中的垃圾邮件
  9. iphone投影到电脑屏幕,QuickTime出现报错和黑屏的解决方案
  10. PS制作一寸照片具体过程