Created
May 13, 2012 19:45
-
-
Save colinta/2689911 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def rgba_color(r, g, b, a=1) | |
UIColor.colorWithRed((r/255.0), green:(g/255.0), blue:(b/255.0), alpha:a) | |
end | |
class MyApplicationController < UIViewController | |
def viewDidLoad | |
font = UIFont.fontWithName('DS-Digital', size:20) | |
color = rgba_color(255, 255, 255) | |
@label = UILabel.new | |
@label.font = font | |
@label.textColor = color | |
@label.text = 'DS-Digital font' | |
@label.frame = [[0, 0], [self.width, self.height]] | |
@label.lineBreakMode = UILineBreakModeWordWrap | |
@label.numberOfLines = 0 | |
@label.setBackgroundColor(UIColor.clearColor); | |
shadow_color = rgba_color(200, 200, 255) | |
@label.layer.shadowColor = shadow_color.CGColor; | |
@label.layer.shadowOffset = [2, 2]; | |
@label.layer.shadowRadius = 2.0; | |
@label.layer.shadowOpacity = 1.0; | |
@label.layer.masksToBounds = false; | |
@label.sizeToFit | |
view.addSubview(@label) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment