When I flip UIButton using key path @"transform.rotation.y", I can still see the front side of the UIbutton.
Is there anyway I can hide buttons front view contents and show a plain backside?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, I believe what you want is not possible. A view or layer does not have a backside that is different from its front – if it did, it would need more properties to set its backside color etc. The
CALayerclass has adoubleSidedproperty. If you set it toNO(button.layer.doubleSided = NO;), the layer is automatically hidden when it faces away from the viewer but that’s probably not what you want.As a workaround, place another view at the same coordinates/frame as your button that has your desired backside color. If you sets this view’s initial rotation transform to 180 degrees, then set both layers to
doubleSided = NOand then rotate both views by 180 degrees, the button should disappear and the other view should appear. Note that I haven’t tried this out.