AboutView.m
资源名称:PushBox.rar [点击查看]
上传用户:qhdwjd2004
上传日期:2020-12-29
资源大小:362k
文件大小:2k
源码类别:
iPhone
开发平台:
Objective-C
- #import "AboutView.h"
- #import "MainView.h"
- @implementation AboutView
- - (id)initWithFrame:(CGRect)rect
- {
- if((self == [super initWithFrame:rect])!=nil)
- {
- navBar = [ [UINavigationBar alloc] initWithFrame: CGRectMake(0, 0, 320, 48)];
- [ navBar setDelegate: self ];
- [ navBar enableAnimation ];
- [ navBar setBarStyle: 0 ];
- [ navBar showLeftButton:nil withStyle: 0 rightButton:@"Back" withStyle: 0 ];
- [ self addSubview: navBar ];
- [self setMarginTop:48];
- NSString *str = [NSString stringWithFormat: @"file://%@",[[NSString alloc]initWithCString: About_Path]];
- NSURL *url = [NSURL URLWithString:str];
- NSMutableString *aboutContent = [NSMutableString stringWithCapacity:10240];
- if(url){
- NSError *err;
- NSString *fname = [[NSString alloc] initWithContentsOfURL:url encoding: NSUTF8StringEncoding error:NULL];
- NSLog(fname);
- if(fname && [fname length] > 0){
- [aboutContent appendString:fname];
- }
- }
- [self setTextSize:16];
- [self setHTML:aboutContent];
- [self setEditable:NO];
- [self setContentSize:CGSizeMake(320,800)];
- [self setAllowsRubberBanding: YES];
- }
- return self;
- }
- - (void)dealloc
- {
- [self dealloc];
- [super dealloc];
- }
- -(void)setParentView:(UIView*)view
- {
- parentView = view;
- }
- // 导航栏
- - (void)navigationBar:(UINavigationBar *)navbar buttonClicked:(int)button
- {
- [(MainView*)parentView showCover];
- }
- @end