Unresponsive UIToolbar – Subview of a UIWebView


hi everyone, i'm encountering problem in iphone/ipad application in have uitoolbar subview of uiwebview. however, when add buttons toolbar, these buttons not responsive... appreciated!

here code:
code:
  - (void)viewdidload {      [super viewdidload];  	  	resourcesviewcontroller.scalespagetofit = yes;  	  	[resourcesviewcontroller loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:@"google.com"]]];  	  	//toolbar code  	toolbar = [[uitoolbar alloc] init];  	[[uidevice currentdevice] begingeneratingdeviceorientationnotifications];  	[toolbar sizetofit];  	  	//button code  	studentdirectory = [[uibarbuttonitem alloc] initwithtitle:@"student directory" style:uibarbuttonitemstylebordered target:self action:@selector(studir:)];  	passwordreset = [[uibarbuttonitem alloc] initwithtitle:@"password reset" style:uibarbuttonitemstylebordered target:self action:@selector(resetpass:)];  	[toolbar setitems:[nsarray arraywithobjects:studentdirectory,passwordreset,nil]];  	  	if (ui_user_interface_idiom() == uiuserinterfaceidiompad)  	{  		// device ipad running iphone 3.2 or later.  	         //toolbar  		if ([[uidevice currentdevice] orientation]	== uideviceorientationportrait || [[uidevice currentdevice] orientation] == uideviceorientationportraitupsidedown) {  			[toolbar setframe:cgrectmake( 0, -31, 768, 31)];  			[resourcesviewcontroller addsubview:toolbar];  		}  		else {  		[toolbar setframe:cgrectmake( 0, -31, 1024, 31)];  			[resourcesviewcontroller addsubview:toolbar];  		}  			  	}  	else  	{  		// device iphone or ipod touch.  		[toolbar setframe:cgrectmake( 0, -32, 320, 32)];  		[resourcesviewcontroller addsubview:toolbar];  	}  	    	  	    }    -(void)resetpass:(id)sender {  	nslog(@"i pressed :d");  	[resourcesviewcontroller loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:@"google.com"]]];    }  	  -(void)studir:(id)sender {  	nslog(@"i pressed :d");  	[resourcesviewcontroller loadrequest:[nsurlrequest requestwithurl:[nsurl urlwithstring:@"google.com"]]];  }    
 

i've been wondering same thing! i'd create bookmarks-toolbar sort of thing subview of uiwebview (like mobile safari), i've not been able figure out how. thoughts on appreciated.... thanks!
 


Forums iPhone, iPad, and iPod Touch iOS Programming


  • iPhone
  • Mac OS & System Software
  • iPad
  • Apple Watch
  • Notebooks
  • iTunes
  • Apple ID
  • iCloud
  • Desktop Computers
  • Apple Music
  • Professional Applications
  • iPod
  • iWork
  • Apple TV
  • iLife
  • Wireless

Comments