ios - CGPoint values in setContentOffset -


so, i'm making scroll , scroll down button on uiwebview. ideally, user have option scroll through finger, or tapping button. when tap button, scroll down inch or so. code i'm working (thanks danypata):

    //scroll up: -(ibaction)scrollcontentup:(id)sender {      [_viewweb.scrollview setcontentoffset:_viewweb.scrollview.contentoffset.y - 10.0 animated:yes]; }  //scroll down: -(ibaction)scrollcontentdown:(id)sender {     [_viewweb.scrollview setcontentoffset:_viewweb.scrollview.contentoffset.y + 10.0 animated:yes]; } 

the issue lies 10.0. i'm getting error: sending double parameter of incompatible type cgpoint (aka struct cgpoint)

i've never worked cgpoints before, , have tried researching them goes way o ver head. know plug code achieve scroll effect?

in code passing float value in place ofcgppoint that's why getting error. set cgpointmake(x,y) value contentoffset value.

[_viewweb.scrollview setcontentoffset:cgpointmake(0,_viewweb.scrollview.contentoffset.y - 10.0) animated:yes]; 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -