Hey guys!
I am not 100% sure if this is the correct section, but I am creating an app using Theos (without Xcode), and I have an issue. My navigation bar is over the UIViewWeb, so I have to scroll down to view the top part of the UIViewWeb.
Here is a screenshot:
Here is my code:
RootViewController.mm
RootViewController.h
main.m
Thanks in advanced, I really appreciate it. I am really new to this new Obective-C stuff and it's really complicated right now. If this is in the wrong section, @moderators, please move it to a right one. Thank you.
I am not 100% sure if this is the correct section, but I am creating an app using Theos (without Xcode), and I have an issue. My navigation bar is over the UIViewWeb, so I have to scroll down to view the top part of the UIViewWeb.
Here is a screenshot:

Here is my code:
RootViewController.mm
Code:
#import "RootViewController.h"
@implementation RootViewController
- (void)viewDidLoad {
[super viewDidLoad];
webview=[[UIWebView alloc]initWithFrame:self.view.bounds];
NSString *url=@"http://localhost/";
NSURL *nsurl=[NSURL URLWithString:url];
NSURLRequest *nsrequest=[NSURLRequest requestWithURL:nsurl];
[webview loadRequest:nsrequest];
[self.view addSubview:webview];
navBar = [[UINavigationBar alloc] init];
navBar.frame = CGRectMake(0, 0, self.view.frame.size.width, 44);
UINavigationItem*navItem = [[[UINavigationItem alloc] initWithTitle:@"iPaint"] autorelease];
UIBarButtonItem*leftButton = [[[UIBarButtonItem alloc] initWithTitle:@"Left" style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonPressed)] autorelease];
navItem.leftBarButtonItem = leftButton;
UIBarButtonItem*rightButton = [[[UIBarButtonItem alloc] initWithTitle:@"Right" style:UIBarButtonItemStylePlain target:self action:@selector(rightButtonPressed)] autorelease];
navItem.rightBarButtonItem = rightButton;
navBar.barStyle = UIBarStyleDefault;
navBar.items = [NSArray arrayWithObject:navItem];
[self.view addSubview:navBar];
}
-(void)leftButtonPressed{
//Code Here
}
-(void)rightButtonPressed{
//Code Here
}
@end
RootViewController.h
Code:
@interface RootViewController: UIViewController {
UIWebView *webview;
UINavigationBar*navBar;
@end
}
main.m
Code:
int main(int argc, char **argv) {
NSAutoreleasePool *p = [[NSAutoreleasePool alloc] init];
int ret = UIApplicationMain(argc, argv, @"comvlad1kwebApplication", @"comvlad1kwebApplication");
[p drain];
return ret;
}
Thanks in advanced, I really appreciate it. I am really new to this new Obective-C stuff and it's really complicated right now. If this is in the wrong section, @moderators, please move it to a right one. Thank you.