ios - how to show popup from Web-view in Objective c -
i getting data url . showing in web-view fine,but requirement want add references functionality wikipedia shown in image . in wikipedia when click tag scroll down position requirement when user click on reference want show popup . possible?
thanks in advance.
you can make use of uiwebviewdelegate method
- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype
this called before web view begins loading.
here argument uiwebviewnavigationtype
enum, holds value of navigation type, check whether navigationtype uiwebviewnavigationtypelinkclicked
. if yes means webview loading page because of of link clicked.
code this
- (bool)webview:(uiwebview *)webview shouldstartloadwithrequest:(nsurlrequest *)request navigationtype:(uiwebviewnavigationtype)navigationtype { if (navigationtype == uiwebviewnavigationtypelinkclicked) { uialertview *alert = [[uialertview alloc] initwithtitle:@"url" message:[[request url] absolutestring] delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alert show]; } return yes; }
hope helps you.
Comments
Post a Comment