- html 绘制ios时钟,iOS-模仿苹果时钟选择控件
欧尼酱牌酱牛肉
html绘制ios时钟
最近看了苹果自带应用时钟上的时间选择工具感觉挺巧妙的,就尝试着模仿它做出一个控件工具。工程Demo运行效果如下:AppleAlram.gif根据时钟选择工具上面的功能,大概可以确定,圆环的绘制我们可以通过CAShapeLayer结合UIBezierPath绘制出来,当拖动起始点或者结束点View时,通过手势判断拖动的角度,从而改变UIBezierPath的角度,并且让起始点或者结束点View根据拖
- iOS自定义带两个圆角的UILabel
雪山飞狐_91ae
这里要实现的是带有两个圆角的自定义的UIlabel两个圆角的UIlabel.png主要思路是利用贝塞尔曲线绘制masklayer的轨迹。下面直接看代码:#import"CustomizeLabel.h"@interfaceCustomizeLabel()@property(nonatomic,strong)CAShapeLayer*maskLayer;@property(nonatomic,str
- iOS Swift 圆环进度条
rome753
截屏2022-03-07上午10.16.41.png用CAShapeLayer和UIBezierPath贝塞尔曲线实现,每次进度变化时,重新初始化一个CAShapeLayer添加到当前UIView上。importFoundationimportUIKitclassCircleProgressView:UIView{//灰色静态圆环varstaticLayer:CAShapeLayer!//进度可变
- iOS-UIBezierPath动画之果冻动画
香橙柚子
我们今天做一个简单的贝塞尔曲线动画,做这个动画之前,我们要对UIBezierPath有简单的了解。贝塞尔曲线基础知识,可以参考下面文章:iOS-贝塞尔曲线(UIBezierPath)的使用iOS-贝塞尔曲线(UIBezierPath)详解(CAShapeLayer)效果图我们先看效果图:动画效果图动画的几个关键点ABCDQ点我们的动画其实就是ABCDQ,这五个点画的图,其中Q点是关键点,就是贝塞尔
- iOS 给某个 view设置某个 角的圆角
冬日的太阳_c107
项目中遇到记录一下借助UIBezierPath与CAShapeLayer进行实现//创建viewUIView*view=[[UIViewalloc]initWithFrame:CGRectMake(100,100,300,300)];view.backgroundColor=[UIColorredColor];//添加view[self.viewaddSubview:view];UIBezierP
- 使用UIBezierPath和CAShapeLayer高效为UIView添加圆角
知更鸟Coollee
ios开发view圆角uiviewuibutton需求
我们在实际开发中,经常会遇到为某个view添加圆角的需求,这样出来的view的效果是比较好看的,那么平时用的最多的实现方式是什么呢?或许你也和我一样:UIButton*btn=[[UIButtonalloc]initWithFrame:CGRectMake(0,0,200,40)];btn.layer.cornerRadius=5;btn.clipsToBounds=YES;虽说这样也可以实现效果
- iOS 实现一个颜色渐变的弧形进度条 CAShapeLayer CAGradientLayer UIBezierPath
海的天空1661
ocCAShapeLayerCAGradientLayerUIBezierPath进度条
渐变色圆弧形进度条,本文用CAShapeLayerCAGradientLayerUIBezierPath来实现。不过过程中需要注意mask这个概念,这个后面会详细说到。1:首先创建CAGradientLayer,一个你需要的渐变的颜色的layer,并且加到父view上。/**创建彩色layer并把layer添加到view的layer上*/-(void)setMuchColor{CAGradient
- iOS 12奇葩问题之CGContextRef和UIBezierPath冲突
DeCori
A.m-(CAShapeLayer*)createIndicatorWithColor:(UIColor*)colorandPosition:(CGPoint)point{CAShapeLayer*layer=[CAShapeLayernew];UIBezierPath*bezierPath=[UIBezierPathbezierPath];[bezierPathmoveToPoint:CGPoi
- iOS CoreAnimation教程 第五篇
人魔七七
CoreAnimation虚线的设置。ineDashPattern,虚线设置,为一个数组,数组中奇数位实线长度,偶数位带遍空白长度。注意最好是偶数否则你看着这个效果不规则。CAShapeLayer*oval=[CAShapeLayerlayer];oval.frame=CGRectMake(187.3,88.5,151,151);oval.lineJoin=kCALineJoinRound;ova
- 绘制view形状
Artificer
最近有个需求,是仿照微信公众号做一个界面,里面有一个弹出菜单。这次我选择自己绘制弹出菜单,而不是让UI切图。菜单样式.png直接上代码//初始化遮罩CAShapeLayer*maskLayer=[CAShapeLayerlayer];maskLayer.strokeColor=[UIColorblueColor].CGColor;//kColorWithRGB(221,222,223).CGCol
- 贝塞尔曲线处理圆角
邓布利多教授
.h文件@interfaceLYBezierPath:NSObject/**圆角处理@paramview需要圆角化的视图@paramcorners需要圆角的边角@paramradii需要圆角的尺寸@returnCAShapeLayer*/+(CAShapeLayer*)superView:(UIView*)viewCorners:(UIRectCorner)cornersRadii:(CGSize
- iOS绘图 ~ CAShapeLayer和贝塞尔曲线UIBezierPath
阳光下的叶子呵
先撸一波从各路大神那里扒来的概率,以及感谢各位大神精心写的教程。以下是按自己的理解简单整理的,理解不对的地方,如果有大神看到,还望多指教。关于CGContext(UIBezierPath)和CAShapeLayer:1.CGContext和UIBezierPath(基于CGContext的封装),在绘制(stroke)和填充(fill)的时候,是需要在视图的drawRect:方法中完成的。系统会在
- 折线图的实现
海笙樾
屏幕快照2018-10-2217.26.15.png这个主要用到了两个类UIBezierPath和CAShapeLayer首先创建一个继承与Controller类,暂且命名LineGraphView,并在其.m文件创建坐标轴#defineMAINSCREEN[UIScreenmainScreen].bounds#import"LineGraphView.h"#defineLABLEX50@impl
- Swift 绘制虚线
萤火驻守心间
image.pnglineLength:虚线长度lineSpacing:虚线间的间距privatefuncdrawDashLine(lineView:UIView,lineLength:Int,lineSpacing:Int,lineColor:UIColor){letshapeLayer=CAShapeLayer()shapeLayer.bounds=lineView.boundsshapeLa
- 从一个实际问题说说CAShapelayer
Kirn
CoreAnimation图层不仅仅只有CALayer这种简单的图片和颜色绘制的功能,还有一些专用图层,如:CAShapeLayer、CATextLayer、CAGradientLayer、CAEAGLLayer、AVPlayerLayer、CAScrollLayer等。我在过去的工作中用过其中的大部分,而使用频率最高的应该就是CAShapeLayer。CAShapeLayer是一个通过矢量图形而
- 在使用Masnory的同时,使用CAShapeLayer和UIBezierPath设置圆角无效
CL0601
今天在使用UIBezierPath给UIImageView设置任意圆角的时候发现图片不展示了,源码是这样的:-(UIImageView*)imageV{if(!_imageV){_imageV=[[UIImageViewalloc]init];_imageV.contentMode=UIViewContentModeScaleAspectFill;UIBezierPath*rounded=[UIB
- Swift - 使用了CAShapeLayer的清除方法
Timidvb
在需要画虚线时会使用到CAShapeLayer,特别是在TableViewCell中使用的情况,在layer被添加后无法再得到当初的对象。如果需要清除之前画下的图形(cell复用时会导致图形重复),调用forsublayerinself.layer.sublayers!wheresublayerisCAShapeLayer{sublayer.removeFromSuperlayer()}
- swift - button中间扩散动画
lotawei
看见一个漂亮的按钮动画现将其实现从中间扩散的动画拿去不谢!看起来还是挺屌的无非是使用CAShapreLayer和CABasicAnimation进行封装(个人还是希望能有相关从业者看到这篇文章,以前我写的东西都不会这样精细地去打磨下?因为我不会告诉你我以前写都是写cashapelayer),关于这两个不过多的说它们具体的细节本篇只需要知道如何利用CAShapreLayer和CGPath来做一个算是
- iOS给一个view添加虚线边框
MonkeyHan
-(void)addDottedLineFromImageView:(UIView*)bView{bView.layer.cornerRadius=4;CAShapeLayer*borderLayer=[[CAShapeLayeralloc]init];borderLayer.bounds=bView.bounds;borderLayer.position=CGPointMake(bView.ce
- iOS Swift 内阴影 2
Yuency
前言:绘制内阴影,原作者地址:https://www.jianshu.com/p/b4d1a0b6439a发现了一个大师写的内阴影代码,挺好用的,但是直接复制粘贴有报错,我修改了下报错。效果图:内阴影.PNG上代码!WLInnerShadow.swiftimportUIKitclassWLInnerShadow:CAShapeLayer{varinnerShadowColor:CGColor?=U
- 2022-08-10
小卒的梦
publicstructSectionLayerShadowPosition:OptionSet{publicinit(rawValue:RawValue){self.rawValue=rawValue}publicletrawValue:Intpublicstaticvartop=SectionLayerShadowPosition.init(rawValue:1CAShapeLayer{let
- CAShapeLayer + BezierPath 处理图形编辑
Realank
我们做图形编辑的时候,做了一个ShapeOperator类来操作图形,里面存储了图形的尺寸位置、旋转角度等信息,可以生成贝塞尔曲线,将其赋值给CAShapeLayer即可完成渲染旋转SO上找到了操作贝塞尔曲线旋转的最佳实践:https://stackoverflow.com/questions/13738364/rotate-cgpath-without-changing-its-position
- iOS CAShapeLayer和CAGradientLayer
假装你是大灰狼
iOS图像动画iosCAShapeLayerCAGradientLayer
CAShapeLayer类CAShapeLayer继承自CALayer的,通过矢量图形绘制图层子类,指定诸如颜色和线宽等属性,用CGPath来绘制图形,常与UIBezierPath配合使用。CAShapeLayer主要属性//路径@property(nullable)CGPathRefpath;//填充颜色@property(nullable)CGColorReffillColor;//线条颜色@
- iOS OC 高效圆角、圆角边框色
兜兜Jerry
开发中常用到圆角,圆角边框色等,现在记录一种高效绘制方式:主要用到类有:UIBezierPath、CAShapeLayer仅仅圆角,直接上代码:UIImageView*img=[[UIImageViewalloc]initWithFrame:CGRectMake([AdapteradapterWidthBy6s:30],0,[AdapteradapterWidthBy6s:200],[Adapte
- 水纹波浪效果实现
木子木木易
#import"FirstWaves.h"@interfaceFirstWaves()@property(nonatomic,strong)CADisplayLink*wavesDisplayLink;@property(nonatomic,strong)CAShapeLayer*firstWavesLayer;@property(nonatomic,strong)UIColor*firstWav
- view设置制定的圆角
放肆的洒脱
UIBezierPath*maskPath=[UIBezierPathbezierPathWithRoundedRect:view.boundsbyRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRightcornerRadii:CGSizeMake(6,6)];CAShapeLayer*maskLayer=[[CAShapeLayerallo
- QQ粘性布局
会写bug的程序媛
#import@interfaceBageValueButton:UIButton@end#import"BageValueButton.h"@interfaceBageValueButton()@property(nonatomic,strong)CAShapeLayer*shapL;@property(nonatomic,strong)UIView*smallCircle;@property(
- iOS 圆角设置
候鸟0706
使用CAShapeLayer和UIBezierPath设置圆角UIView*bottomView=[[UIViewalloc]initWithFrame:CGRectMake(0,ScreenHeight-50,ScreenWidth,50)];[self.viewaddSubview:bottomView];UIBezierPath*maskPath=[UIBezierPathbezierPat
- iOS部分圆角
YimG
使用CAShapeLayer+UIBezierPath方式UIBezierPath*maskPath=[UIBezierPathbezierPathWithRoundedRect:VIEW.boundsbyRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRightcornerRadii:CGSizeMake(15,0)];CAShapeLaye
- Swift绘制雷达图(蛛网图、五方图)
孙国立
前言由于项目需求中用到了带有渐变色的能力雷达图,而我们常用的一些三方控件并不能满足我的项目需求。特此记录一下自己的实现此功能的过程。主要使用UIBezierPath路径相关、CAShapeLayer绘制相关、CAGradientLayer渐变色相关,通过对上述三个类的组合来实现此功能。先上一下效果图雷达图.png最终的实现效果会有一点出入,主要是背景颜色和文字颜色可能会有点不同。如有需要大家可以自
- ASM系列四 利用Method 组件动态注入方法逻辑
lijingyao8206
字节码技术jvmAOP动态代理ASM
这篇继续结合例子来深入了解下Method组件动态变更方法字节码的实现。通过前面一篇,知道ClassVisitor 的visitMethod()方法可以返回一个MethodVisitor的实例。那么我们也基本可以知道,同ClassVisitor改变类成员一样,MethodVIsistor如果需要改变方法成员,注入逻辑,也可以
- java编程思想 --内部类
百合不是茶
java内部类匿名内部类
内部类;了解外部类 并能与之通信 内部类写出来的代码更加整洁与优雅
1,内部类的创建 内部类是创建在类中的
package com.wj.InsideClass;
/*
* 内部类的创建
*/
public class CreateInsideClass {
public CreateInsideClass(
- web.xml报错
crabdave
web.xml
web.xml报错
The content of element type "web-app" must match "(icon?,display-
name?,description?,distributable?,context-param*,filter*,filter-mapping*,listener*,servlet*,s
- 泛型类的自定义
麦田的设计者
javaandroid泛型
为什么要定义泛型类,当类中要操作的引用数据类型不确定的时候。
采用泛型类,完成扩展。
例如有一个学生类
Student{
Student(){
System.out.println("I'm a student.....");
}
}
有一个老师类
- CSS清除浮动的4中方法
IT独行者
JavaScriptUIcss
清除浮动这个问题,做前端的应该再熟悉不过了,咱是个新人,所以还是记个笔记,做个积累,努力学习向大神靠近。CSS清除浮动的方法网上一搜,大概有N多种,用过几种,说下个人感受。
1、结尾处加空div标签 clear:both 1 2 3 4
.div
1
{
background
:
#000080
;
border
:
1px
s
- Cygwin使用windows的jdk 配置方法
_wy_
jdkwindowscygwin
1.[vim /etc/profile]
JAVA_HOME="/cgydrive/d/Java/jdk1.6.0_43" (windows下jdk路径为D:\Java\jdk1.6.0_43)
PATH="$JAVA_HOME/bin:${PATH}"
CLAS
- linux下安装maven
无量
mavenlinux安装
Linux下安装maven(转) 1.首先到Maven官网
下载安装文件,目前最新版本为3.0.3,下载文件为
apache-maven-3.0.3-bin.tar.gz,下载可以使用wget命令;
2.进入下载文件夹,找到下载的文件,运行如下命令解压
tar -xvf apache-maven-2.2.1-bin.tar.gz
解压后的文件夹
- tomcat的https 配置,syslog-ng配置
aichenglong
tomcathttp跳转到httpssyslong-ng配置syslog配置
1) tomcat配置https,以及http自动跳转到https的配置
1)TOMCAT_HOME目录下生成密钥(keytool是jdk中的命令)
keytool -genkey -alias tomcat -keyalg RSA -keypass changeit -storepass changeit
- 关于领号活动总结
alafqq
活动
关于某彩票活动的总结
具体需求,每个用户进活动页面,领取一个号码,1000中的一个;
活动要求
1,随机性,一定要有随机性;
2,最少中奖概率,如果注数为3200注,则最多中4注
3,效率问题,(不能每个人来都产生一个随机数,这样效率不高);
4,支持断电(仍然从下一个开始),重启服务;(存数据库有点大材小用,因此不能存放在数据库)
解决方案
1,事先产生随机数1000个,并打
- java数据结构 冒泡排序的遍历与排序
百合不是茶
java
java的冒泡排序是一种简单的排序规则
冒泡排序的原理:
比较两个相邻的数,首先将最大的排在第一个,第二次比较第二个 ,此后一样;
针对所有的元素重复以上的步骤,除了最后一个
例题;将int array[]
- JS检查输入框输入的是否是数字的一种校验方法
bijian1013
js
如下是JS检查输入框输入的是否是数字的一种校验方法:
<form method=post target="_blank">
数字:<input type="text" name=num onkeypress="checkNum(this.form)"><br>
</form>
- Test注解的两个属性:expected和timeout
bijian1013
javaJUnitexpectedtimeout
JUnit4:Test文档中的解释:
The Test annotation supports two optional parameters.
The first, expected, declares that a test method should throw an exception.
If it doesn't throw an exception or if it
- [Gson二]继承关系的POJO的反序列化
bit1129
POJO
父类
package inheritance.test2;
import java.util.Map;
public class Model {
private String field1;
private String field2;
private Map<String, String> infoMap
- 【Spark八十四】Spark零碎知识点记录
bit1129
spark
1. ShuffleMapTask的shuffle数据在什么地方记录到MapOutputTracker中的
ShuffleMapTask的runTask方法负责写数据到shuffle map文件中。当任务执行完成成功,DAGScheduler会收到通知,在DAGScheduler的handleTaskCompletion方法中完成记录到MapOutputTracker中
- WAS各种脚本作用大全
ronin47
WAS 脚本
http://www.ibm.com/developerworks/cn/websphere/library/samples/SampleScripts.html
无意中,在WAS官网上发现的各种脚本作用,感觉很有作用,先与各位分享一下
获取下载
这些示例 jacl 和 Jython 脚本可用于在 WebSphere Application Server 的不同版本中自
- java-12.求 1+2+3+..n不能使用乘除法、 for 、 while 、 if 、 else 、 switch 、 case 等关键字以及条件判断语句
bylijinnan
switch
借鉴网上的思路,用java实现:
public class NoIfWhile {
/**
* @param args
*
* find x=1+2+3+....n
*/
public static void main(String[] args) {
int n=10;
int re=find(n);
System.o
- Netty源码学习-ObjectEncoder和ObjectDecoder
bylijinnan
javanetty
Netty中传递对象的思路很直观:
Netty中数据的传递是基于ChannelBuffer(也就是byte[]);
那把对象序列化为字节流,就可以在Netty中传递对象了
相应的从ChannelBuffer恢复对象,就是反序列化的过程
Netty已经封装好ObjectEncoder和ObjectDecoder
先看ObjectEncoder
ObjectEncoder是往外发送
- spring 定时任务中cronExpression表达式含义
chicony
cronExpression
一个cron表达式有6个必选的元素和一个可选的元素,各个元素之间是以空格分隔的,从左至右,这些元素的含义如下表所示:
代表含义 是否必须 允许的取值范围 &nb
- Nutz配置Jndi
ctrain
JNDI
1、使用JNDI获取指定资源:
var ioc = {
dao : {
type :"org.nutz.dao.impl.NutDao",
args : [ {jndi :"jdbc/dataSource"} ]
}
}
以上方法,仅需要在容器中配置好数据源,注入到NutDao即可.
- 解决 /bin/sh^M: bad interpreter: No such file or directory
daizj
shell
在Linux中执行.sh脚本,异常/bin/sh^M: bad interpreter: No such file or directory。
分析:这是不同系统编码格式引起的:在windows系统中编辑的.sh文件可能有不可见字符,所以在Linux系统下执行会报以上异常信息。
解决:
1)在windows下转换:
利用一些编辑器如UltraEdit或EditPlus等工具
- [转]for 循环为何可恨?
dcj3sjt126com
程序员读书
Java的闭包(Closure)特征最近成为了一个热门话题。 一些精英正在起草一份议案,要在Java将来的版本中加入闭包特征。 然而,提议中的闭包语法以及语言上的这种扩充受到了众多Java程序员的猛烈抨击。
不久前,出版过数十本编程书籍的大作家Elliotte Rusty Harold发表了对Java中闭包的价值的质疑。 尤其是他问道“for 循环为何可恨?”[http://ju
- Android实用小技巧
dcj3sjt126com
android
1、去掉所有Activity界面的标题栏
修改AndroidManifest.xml 在application 标签中添加android:theme="@android:style/Theme.NoTitleBar"
2、去掉所有Activity界面的TitleBar 和StatusBar
修改AndroidManifes
- Oracle 复习笔记之序列
eksliang
Oracle 序列sequenceOracle sequence
转载请出自出处:http://eksliang.iteye.com/blog/2098859
1.序列的作用
序列是用于生成唯一、连续序号的对象
一般用序列来充当数据库表的主键值
2.创建序列语法如下:
create sequence s_emp
start with 1 --开始值
increment by 1 --増长值
maxval
- 有“品”的程序员
gongmeitao
工作
完美程序员的10种品质
完美程序员的每种品质都有一个范围,这个范围取决于具体的问题和背景。没有能解决所有问题的
完美程序员(至少在我们这个星球上),并且对于特定问题,完美程序员应该具有以下品质:
1. 才智非凡- 能够理解问题、能够用清晰可读的代码翻译并表达想法、善于分析并且逻辑思维能力强
(范围:用简单方式解决复杂问题)
- 使用KeleyiSQLHelper类进行分页查询
hvt
sql.netC#asp.nethovertree
本文适用于sql server单主键表或者视图进行分页查询,支持多字段排序。KeleyiSQLHelper类的最新代码请到http://hovertree.codeplex.com/SourceControl/latest下载整个解决方案源代码查看。或者直接在线查看类的代码:http://hovertree.codeplex.com/SourceControl/latest#HoverTree.D
- SVG 教程 (三)圆形,椭圆,直线
天梯梦
svg
SVG <circle> SVG 圆形 - <circle>
<circle> 标签可用来创建一个圆:
下面是SVG代码:
<svg xmlns="http://www.w3.org/2000/svg" version="1.1">
<circle cx="100" c
- 链表栈
luyulong
java数据结构
public class Node {
private Object object;
private Node next;
public Node() {
this.next = null;
this.object = null;
}
public Object getObject() {
return object;
}
public
- 基础数据结构和算法十:2-3 search tree
sunwinner
Algorithm2-3 search tree
Binary search tree works well for a wide variety of applications, but they have poor worst-case performance. Now we introduce a type of binary search tree where costs are guaranteed to be loga
- spring配置定时任务
stunizhengjia
springtimer
最近因工作的需要,用到了spring的定时任务的功能,觉得spring还是很智能化的,只需要配置一下配置文件就可以了,在此记录一下,以便以后用到:
//------------------------定时任务调用的方法------------------------------
/**
* 存储过程定时器
*/
publi
- ITeye 8月技术图书有奖试读获奖名单公布
ITeye管理员
活动
ITeye携手博文视点举办的8月技术图书有奖试读活动已圆满结束,非常感谢广大用户对本次活动的关注与参与。
8月试读活动回顾:
http://webmaster.iteye.com/blog/2102830
本次技术图书试读活动的优秀奖获奖名单及相应作品如下(优秀文章有很多,但名额有限,没获奖并不代表不优秀):
《跨终端Web》
gleams:http