cagradientlayer

    0热度

    1回答

    我想让我的UIScrollView的末端淡出 - 就像一个UITableView。我找到了下面的代码。我在一个名为initWithFrame:...的方法中使用它在UIScrollView子类中。 if (!maskLayer) { maskLayer = [CAGradientLayer layer]; CGColorRef outerColor = [UIColor c

    1热度

    2回答

    我正在使用以下代码将渐变色设置为标签的背景,但没有效果我做错了什么? 代码是在这里: [self.teamName setTextColor:[UIColor whiteColor]]; [self.teamName setBackgroundColor:[UIColor clearColor]]; CAGradientLayer *gradientLayer = [CAGra

    4热度

    1回答

    我的MKPolyLineView出现问题。我只是尝试为折线制作颜色渐变,但使用CAGradient则可以实现。我的子类MKPolylineView和重绘在 - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context UIColor *darker

    0热度

    1回答

    我想在位于自定义UITableViewCell中的UILabel文本后面添加渐变图层。问题在于渐变隐藏了我标签的文字。我已经访问this链接,但它不适合我。所以我怎样才能将它添加后面的文字层? 我迄今所做的是: CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = CGRectMake(0, 0, bu

    2热度

    1回答

    向UILabel添加背景渐变我使用下面的代码。 在使用渐变之前,UILabel会像这样出现。 现在,添加一个渐变我使用下面的代码。 CAGradientLayer *gradLayer=[CAGradientLayer layer]; gradLayer.frame=self.myView.layer.bounds; [gradLayer setColors:[NSArray

    4热度

    1回答

    我想创建一个具有渐变背景的UIButton。我得到的工作很好,但按钮不会突出显示(默认行为是为了让按钮变暗)。 这里是我的按钮: -(UIButton *)createLoginButtonForSize:(CGSize)size { UIButton *loginButton = [UIButton buttonWithType:UIButtonTypeCustom]; lo

    1热度

    1回答

    我想创建一个UIView深灰色渐变: UIView *sectionSpacer = [[UIView alloc] init]; sectionSpacer.backgroundColor = [UIColor clearColor]; CAGradientLayer *gradient = [CAGradientLayer layer]; gradient.frame = section

    0热度

    1回答

    我正在使用CAGradientLayer来设计我的uibuttons。基本上在一个单元格中有三个按钮。当我首先设置CAGradientLayer属性时,它工作正常(我得到一个渐变)。 但是,当我将CAGradientLayer应用于第二个时,它确实出现在第二个上,但从第一个上消失。如果我在三分之一时间完成,那么它将出现在第三个并从前两个消失。 我应该在UIButton设置之间释放CAGradien

    3热度

    1回答

    我想修改按键的外观和花了很长时间试图弄清楚为什么我不能一个梯度适用于它像下面这个简单的代码: [self.playButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; self.playButton.backgroundColor = [UIColor blackColor]; CAGradient

    0热度

    1回答

    如何让UITableViewCell中的自定义子图层消失setSelected:animated:? 语境: 我已经加入了CAGradientLayer的drawRect:里面加入了自定义背景层我UITableViewCell,像这样: - (void)drawRect:(CGRect)rect{ [super drawRect:rect]; [[self providerL