Giter VIP home page Giter VIP logo

hexagonview's Introduction

HexagonView

六边形带圆角的自定义View,支持图文混排,点击区域,水平垂直方向切换,圆角大小等各种属性

联系方式

  • 邮箱地址: [email protected]
  • QQ群: 489873144 (建议使用QQ群,邮箱使用较少,可能看的不及时)
  • 本群刚建立,旨在为使用我的github项目的人提供方便,如果遇到问题欢迎在群里提问。个人能力也有限,希望一起学习一起进步。

演示

imageimageimage

1.用法

该项目和我github上其他的view相关的项目已经一起打包上传到jCenter仓库中(源码地址 https://github.com/jeasonlzy0216/ViewCore ),使用的时候可以直接使用compile依赖,用法如下

	compile 'com.lzy.widget:view-core:0.1.9'

或者使用

    compile project(':hexagonview')

2.注意

由于该控件不是矩形,所以想要点击事件只在六边形区域有效,需要设置OnHexagonViewClickListener,代码如下:

 hexagon.setOnHexagonClickListener(new HexagonView.OnHexagonViewClickListener() {
	@Override
	public void onClick(View view) {
	    Toast.makeText(HexagonActivity.this, "点击六边形了!", Toast.LENGTH_SHORT).show();
	}
});

3.参数含义

自定义属性名字 参数含义
hexagonText 文字内容
hexagonTextSize 文字大小
hexagonTextColor 文字颜色
hexagonBorderWidtd 边框宽度
hexagonBorderColor 边框颜色
hexagonFillColor 背景填充色
hexagonCorner 圆角大小
hexagonBreakLineCount 换行字节数,一个中文代表两个字节
hexagonMaxLine 允许的最大行数,超过显示...
hexagonTextSpacing 每行文本的间距
hexagonBorderOverlay 边框是否覆盖在背景之上
hexagonOrientation 六边的的方向,横向和

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.