- - (id)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- // Initialization code.
- frame.origin.y += 44;
- frame.size.height -= 44;
- webView = [[UIWebView alloc] initWithFrame:frame];
- bar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, 44)];
- UINavigationItem *item = [[UINavigationItem alloc] initWithTitle:nil];
- UIBarButtonItem *button = [[UIBarButtonItem alloc] initWithTitle:@"Done"
- style:UIBarButtonItemStyleDone
- target:self
- action:@selector(removeSelf)];
- [self addSubview:bar];
- [self addSubview:webView];
- [bar pushNavigationItem:item animated:NO];
- [item setLeftBarButtonItem:button];
- [item release];
- [button release];
- }
- return self;
- }
在UIView上添加一个导航栏
最新推荐文章于 2023-07-25 10:39:54 发布