Created
August 28, 2013 18:29
-
-
Save pegli/6369504 to your computer and use it in GitHub Desktop.
label overlay example
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
// open a single window | |
var win = Ti.UI.createWindow({ | |
backgroundColor:'white' | |
}); | |
// TODO: write your module tests here | |
var OverlayTest = require('com.obscure.overlaytest'); | |
Ti.API.info("module is => " + OverlayTest); | |
var view = OverlayTest.createDerpView({ | |
top: 10, | |
left: 10, | |
width: 100, | |
height: 100, | |
backgroundColor: 'red' | |
}); | |
win.add(view); | |
win.open(); |
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
#import "ComObscureOverlaytestDerpView.h" | |
@implementation ComObscureOverlaytestDerpView | |
- (void)initializeState | |
{ | |
label = [[UILabel alloc] initWithFrame:CGRectZero]; | |
label.text = @"hello, world!"; | |
label.backgroundColor = [UIColor greenColor]; | |
[self addSubview:label]; | |
} | |
- (void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds | |
{ | |
[super frameSizeChanged:frame bounds:bounds]; | |
[TiUtils setView:label positionRect:CGRectMake(5, 5, bounds.size.width - 10, bounds.size.height - 10)]; | |
} | |
@end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment