nfarina / calloutview

A lightweight callout view class for iOS mimicking UICalloutView.
http://nfarina.com/post/78014139253/smcalloutview-for-ios-7
Apache License 2.0
1.2k stars 189 forks source link

Example of customization of background graphics. #71

Open cadizjavier opened 10 years ago

cadizjavier commented 10 years ago

In the README section there is a short how-to of how to customize the background graphics of the calloutview. I can't get quite well how to subclass or extend that in my own code. Specifically in iOS 7+ the most i can do is change some backgrounds colors specifically in a local fork of my source code. As far as i see there isn't a public API to do those kind of things.

Can you show me some example code with the correct way to do this ?? (Customization of the background graphics)

rousseauo commented 9 years ago

You can redefine your own SMCalloutBackgroundView class.

@interface CustomCalloutBackgroundView : SMCalloutBackgroundView

And simply set the background or anything you need to custom in the init. You might need to use a contentView.