2017-12-07  本文已影响0人  昭杏之念

#SharpView gitgub地址这是一个自定义控件,带有微信聊天尖角。目前有TextView,LinearLayout,RelativeLayout.## 效果

## Import```java Step 1. Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories: allprojects {repositories {...maven { url "https://jitpack.io" }}}Step 2. Add the dependencydependencies {        compile 'com.github.zengzhaoxing:SharpView:v2.0.0'}```## Maven```javaStep 1.jitpack.iohttps://jitpack.ioStep 2. Add the dependencycom.github.zengzhaoxingSharpViewv2.0.0```* 自定义属性name | format | instructions-----|------|----radius    | dimension    | radius of the view cornerbackgroundColor  | color    | backgroundColorarrowDirection    | enum    | the sharp location,can be one of the(top,left,right,bottom)relativePosition  | relativePosition| relative position of the sharpsharpSize    | dimension    | sharp length## 使用* 1.In the XML```java```

* 2.In the code

```java

SharpLinearLayout sharpLinearLayout = (SharpLinearLayout) findViewById(R.id.sharp_ll);

//get the SharpViewRenderProxy of the sharpView to refresh sharp

sharpLinearLayout.getRenderProxy().setArrowDirection(SharpView.ArrowDirection.BOTTOM);

sharpLinearLayout.getRenderProxy().setSharpSize(50);

sharpLinearLayout.getRenderProxy().setRelativePosition(0.8f);

sharpLinearLayout.getRenderProxy().setRadius(20);

sharpLinearLayout.getRenderProxy().setBackgroundColor(0xff000000);

```

上一篇 下一篇

猜你喜欢

热点阅读