XBPageCurl icon indicating copy to clipboard operation
XBPageCurl copied to clipboard

User Interaction with curled view

Open murthyveda2000 opened this issue 12 years ago • 11 comments

Hi, I am trying to use this library to curl down the corner of a view and keep it curled down. I just curl the very top corner, so I want the user to be able to continue to interact with the rest of the view while it is curled. Right now, this doesn't seem possible. I started from the SimplePageCurl example and just changed the positions and angles to get it to curl from the top right corner. Now it seems like the curled view is just an image and I can't interact with the controls on the screen.

Any advice would be very appreciated. Very cool library so far. It looks like it will really help me if I can get past this one issue.

murthyveda2000 avatar Oct 30 '12 18:10 murthyveda2000

Are you sure you are using the most up to date version? Did you don anything special with your setup? By default the views behind the curled view will be touchable, only the visible part actually. This is a feature that was added not so long ago.

xissburg avatar Oct 31 '12 03:10 xissburg

It is the view that I am curling that I want to interact with though. The front view has button at the bottom and I just want to turn down its top right corner. I want the rest of the top view to be enabled for user interaction.

murthyveda2000 avatar Oct 31 '12 19:10 murthyveda2000

Oh now I get it. It is not possible to interact with the contents of the view which is being curled, yet. The view is rendered into a texture, so what you actually have on the screen is an static image of it. Perhaps I could change it so that only the curled region and the rear facing part are rendered with OpenGL and the rest I can keep intact. Then, I can delegate the touches inside the page to the curled view and the touches outside the page to the underneath view. I will look into this possibility later..

One possible dirty hack would be to place an identical button/control on top of the original and above the curl view after you start to curl.

xissburg avatar Oct 31 '12 19:10 xissburg

i am also looking for the same :)

bibeputt avatar Nov 01 '12 11:11 bibeputt

Yes, I have added an ugly hack where I put the button on top of the curl view. It does work. Thanks!

murthyveda2000 avatar Nov 01 '12 17:11 murthyveda2000

Can you share that sample with a button over curl view ?

On Nov 1, 2012, at 8:14 PM, murthyveda2000 [email protected] wrote:

Yes, I have added an ugly hack where I put the button on top of the curl view. It does work. Thanks!

— Reply to this email directly or view it on GitHub.

bibeputt avatar Nov 01 '12 17:11 bibeputt

@bibeputt well, just add a button over the curl view. You can add it as subview to the superview of the curl view and to make sure it will appear in the front, you can use the bringSubviewToFront: method.

xissburg avatar Nov 03 '12 12:11 xissburg

I tried to put a Button on the curl view but I got some problems:

  • Button is fullscreen after curl up
  • or button is not available...

Can you post your solution...

mooseDev avatar Dec 03 '12 14:12 mooseDev

@mooseDev do not add the button as a subview of the curlView, it must be a sibling.

xissburg avatar Dec 03 '12 18:12 xissburg

yep I tried but as I mentioned: Button will overlay whole view or is not accessable at all...

UIButton *bt = [[UIButton alloc]initWithFrame:self.curlingView.superview.frame];
bt.backgroundColor = [UIColor yellowColor];
[self.curlingView.superview addSubview:bt];
[self.curlingView.superview bringSubviewToFront:bt];

mooseDev avatar Dec 04 '12 08:12 mooseDev

Well, that is quite weird. I don't think this problem is related to XBPageCurl. Try swapping the XBCurlView with a regular view and see what happens.

xissburg avatar Dec 22 '12 14:12 xissburg