ios颜色渐变

渐变颜色的进度条WGradientProgress-备用

。_饼干妹妹 提交于 2020-02-28 07:56:39
今天我们来实现一个iOS平台上的进度条(progress bar or progress view)。这种进度条比APPLE自带的更加漂亮,更加有“B格”。它拥有渐变的颜色,而且这种颜色是动态移动的,这里称之为WGradientProgress。 先来看看我们的目标长什么样子: WGradientProgress的使用方法很简单,主要有展示接口以及隐藏接口,目前显示的位置有两种选择: WProgressPosDown //progress is on the down border of parent view,显示在parent view的底部(主流做法,默认) WProgressPosUp //progress is on the up border of parent view,也就是显示在parent view的顶部 主要的接口有以下几个: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 + (WGradientProgress *)sharedInstance; /** * the main interface to show WGradientProgress obj, position is WProgressPosDown by default. * * @param parentView which

iOS中为控件设置颜色渐变和透明度渐变

ε祈祈猫儿з 提交于 2020-01-08 05:18:32
项目中用到地图设置渐变色,查找资料找到两种方法:一种设置颜色,一种设置透明度; //为颜色设置渐变效果: UIView *view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 40, 40)]; CAGradientLayer *gradient = [CAGradientLayer layer]; //设置开始和结束位置 (设置渐变的方向 ) gradient.startPoint = CGPointMake(0, 0); gradient.endPoint = CGPointMake(1, 0); gradient. frame = CGRectMake ( 0 , 0 , 40 , 40 ); gradient.colors = [NSArray arrayWithObjects:(id)[UIColor redColor].CGColor, ( id )[ UIColor whiteColor ]. CGColor , nil ]; [view.layer insertSublayer:gradient atIndex:0]; [self.view addSubview:view]; //为透明度设置渐变效果 UIView *view = [[UIView alloc] initWithFrame:CGRectMake

CSS3学习笔记

前提是你 提交于 2019-11-29 10:00:24
1.text-shadow 文字阴影 2.background-size:背景图大小 经常用于ios手机端的sprite图,先等比缩小一倍,再取值 3.display:flex 拉伸布局 给父元素 子元素用flex:1 3.min-with:最小宽度不能小于多少 4.max-with:最大宽度不能大于多少 5.animation 动画 必须用@keyframes声明后调用 6.background:linear-gradient(位置,颜色,渐变后颜色) 线性渐变 7.transition:过度 8.transform:变形 和相对定位相识 translate()移动 rotate(deg)旋转 scale()缩放 9.transform-origin: 旋转中心点 10.box-sizing:border-box 内减模式 来源: https://www.cnblogs.com/zjfman/p/11512105.html