Search Results

Search found 4 results on 1 pages for 'brenden'.

Page 1/1 | 1 

  • UITableViewCell rounded corners and clip subviews

    - by Brenden
    I can't find anything anywhere(search engines, docs, here, etc) that shows how to create rounded corners (esp. in a grouped table view) on an element that also clips the subviews. I have code that properly creates a rounded rectangle out of a path with 4 arcs(the rounded corners) that has been tested in the drawRect: method in my subclassed uitableviewcell. The issue is that the subviews, which happen to be uibuttons with their internal uiimageviews, do no obey the CGContextClip() that the uitableviewcell obeys. Here is the code: - (void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGFloat radius = 12; CGFloat width = CGRectGetWidth(rect); CGFloat height = CGRectGetHeight(rect); // Make sure corner radius isn't larger than half the shorter side if (radius > width/2.0) radius = width/2.0; if (radius > height/2.0) radius = height/2.0; CGFloat minx = CGRectGetMinX(rect) + 10; CGFloat midx = CGRectGetMidX(rect); CGFloat maxx = CGRectGetMaxX(rect) - 10; CGFloat miny = CGRectGetMinY(rect); CGFloat midy = CGRectGetMidY(rect); CGFloat maxy = CGRectGetMaxY(rect); [[UIColor greenColor] set]; CGContextBeginPath(context); CGContextMoveToPoint(context, minx, midy); CGContextAddArcToPoint(context, minx, miny, midx, miny, radius); CGContextAddArcToPoint(context, maxx, miny, maxx, midy, radius); CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius); CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius); CGContextClip(context); CGContextFillRect(context, rect); [super drawRect:rect]; } Because this specific case is static(only shows in 1 specific row of buttons), I can edit the images being used for the buttons to get the desired effect. HOWEVER, I have another case that is dynamic. Specifically, a grouped table with lots of database-driven results that will show photos that may be in the first or last row with rounded corners and thus needs to be clipped). So, is it possible to create a CGContextClip() that also clips the subviews? If so, how?

    Read the article

  • UIImageView dimensions not what I set in IB

    - by Brenden
    I set a UIImageView to 70x70 pixels. In the actual view they look 70px high and 30 wide. This is when there is no source UIImage set and with a background color so I can see it's layout. However, when I do set a UIImage to it the layout does not change, remains portrait. Is there something I am overlooking that affects the layout dimensions of a UIImage or UIImageView? Thanks.

    Read the article

  • Why has Foundation 4 made its grid classes less natural and readable?

    - by Brenden
    The Background I love responsive CSS grids. I hate Bootstrap's complex class names. I fell in love with Foundations human readable class names. The Problem With Foundation 4, they have changed four columns to large-4 small-4 columns and in my opinion this makes the HTML markup less clear. This style of CSS class names is exactly why I switched from Bootstrap to Foundation. The Question What advantage is gained by Foundation 4's Grid in making this change? It seems that you can have a different grid layout on smaller screens via media queries, but I can't think of a design that would require this. Note: I've been focused on native mobile development and therefore I may be missing out on recent best practices.

    Read the article

  • php search database for row

    - by Brenden Morley
    Okay I got code the code to pull data based on a users account number well here is what im using (And yes I know it isnt safe now that is the reason for my post) <?php include('config.php'); $user_info = fetch_user_info($_GET['AccountNumber']); ?> <html> <body> <div> <?php if ($user_info === false){ $Output = 'http://www.MyDomain.Com/'; echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$Output.'">'; }else{ ?> <center> <title><?php echo $user_info['FirstName'], ' ', $user_info['LastName'], ' - ', $user_info['City'], ', ', $user_info['State']; ?> - Name of site</title> So basically what this code is allowing me to do is have a file called Profile.php And when a user visits this this page it will return the data Like this http://MyDomain.com/Profile.php?AccountNumber=50b9c965b7c3b How can I do this securely cause right now its using a get method really unsafe to retive the account number from the url bar.

    Read the article

1