iphone - Moving a UIWebView on iOS -
i'm working on ios application , i'm having trouble navigation. i'm new xcode , assumption dynamic content handled through webviews. plan have 4 webviews. 1 dynamic content , other 3 options.
my terrible diagram:
http://i.imgur.com/t9l30ug.png
the center view content created via javascript dragged around. example youtube app drag side options.
the final product this, include usual ios overscroll , bounce.
http://i.imgur.com/3xyn0eo.gif
as of right have loaded center web view local html. i'm bit lost go here. here need dragging view , adding easing. realize it's big question, if @ least point me in correct direction, appreciated.
however, if looking @ , thinks i'm going in wrong direction developing structure, please tell me.
thanks guys
while could web views, there's no need so. web views suited displaying mixed-media styled text or arbitrary websites. however, they're quite bit more difficult work doing interactive touch-and-drag kinds of interactions. can it, , if you're expert in javascript, feel free start there , see how things go. if not, there's no need start that.
bonus: if use native views instead of web views, of animations , "rubber-banding" free.
if doing this, i'd create view controller. when loads view, i'd add subview fills bounds of superview. add uipangesturerecognizer
using -[uiview addgesturerecognizer:]
method. when user starts panning, check direction they're moving, , add appropriate options subview behind front view. modify center
property of front view.
based on wording of question, suspect level of detail may not enough you're trying go. there 4 or 5 more steps along way should take first. i'd suggest course of action:
- figure out how display simple content without web view. text, etc.
- figure out how respond button presses, etc., outside of web view.
- figure out how use gesture recognizer make red box follow finger.
- figure out how dynamically add views existing hierarchy. (e.g. add new red box every time touch screen.)
- figure out how make view animate position of touch. (search documentation "uiview animation".)
along way, feel free ask questions, detailing you've tried. once you've done of stuff, think of underlying principles start click. @ point, may ready start on triple-optioned view.
i hope helpful. sounds you've got idea of want, , aren't sure how there. hopefully, these can stepping stones there.
Comments
Post a Comment