Picture Tangent circle, label text with a line at the bottom, custom view transparency gradient effect

Source: Internet
Author: User

1. Picture head cut into circles "not the radius, not the circle."

self. Imgvhead . Clipstobounds =YES;

    self . imgvhead Layer Cornerradius = self imgvhead Bounds Size Height/ 2 ;

self. Imgvhead . Layer. BorderWidth = 0.5f;

    Self.Imgvhead.Layer.BorderColor = [Uicolor colorwithred:0Green:0Blue:0Alpha:0.3].Cgcolor;

2.UILabel Bottom Display a line

nsmutableattributedstring *str = [[nsmutableattributedstringalloc] initwithstring : Self . Lblcheckdetail . Text];

nsrange strrange = {0, [strlength]};

[str addattribute:nsunderlinestyleattributenamevalue: [NSNumber Numberwithinteger: Nsunderlinestylesingle]range: Strrange];

[self. Lblcheckdetail setattributedtext: str];

3. Customize the effect of a transparency gradient

    uicolor *colorone = [uicolor colorwithred :(33 /255.0 )  green :(33 /255.0 )  blue :(33 /255.0 )  alpha : 0.0 ];

    uicolor *colortwo = [uicolor colorwithred :(33 /255.0 )  green :(33 /255.0 )  blue :(33 /255.0 )  alpha : 1.0 ];

nsarray *colors = [nsarrayarraywithobjects:(ID) colorone. Cgcolor, Colortwo. Cgcolor, nil];

nsnumber *stopone = [nsnumbernumberwithfloat:0.0];

nsnumber *stoptwo = [nsnumbernumberwithfloat:1.0];

nsarray *locations = [nsarrayarraywithobjects: Stopone, Stoptwo, Nil];

cagradientlayer *headerlayer = [cagradientlayerlayer];

Headerlayer. colors = colors;

Headerlayer. Locations = locations;

    cgfloat width = self viewgradualalpha Bounds Size Width + screen_width - self cellimgvtop Bounds Size Width

cgfloat height=self. Viewgradualalpha . Bounds. Size. Height;

Headerlayer. frame =cgrectmake(0,0, width, height);

[Self. Viewgradualalpha. Layer insertsublayer: Headerlayer atindex:0];

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Picture Tangent circle, label text with a line at the bottom, custom view transparency gradient effect

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.