Question

I'm have used Toast before in Android. Is there a way to customize the font or font size of Toast on an UIView in iOS?

I am aware of the makeToast function, which seems to only have optional parameters for duration, position, image, and title. Or is there another messaging/notification system I should be using instead?

I already found this answer for Android.

Était-ce utile?

La solution

Turns out toast is not native to obj-C like I originally thought? Growl/toast style notifications library for iOS

It looks like the github project was already included in some of the legacy code I've been going through... but adding such custom features would not be an iOS issue like I thought, it'd be working on the github project.

Also, turns out that there's a native iOS library message system: UIAlertView

Autres conseils

There is no Toast-like in iOS, but you can use something similar called popover. Popovers are from the documentations:

is used to manage the presentation of content in a popover. You use popovers to present information temporarily. The popover content is layered on top of your existing content and the background is dimmed automatically. The popover remains visible until the user taps outside of the popover window or you explicitly dismiss it. Popover controllers are for use exclusively on iPad devices. Attempting to create one on other devices results in an exception. However popovers only available in iPads.

I would recommend the following control for you to use on iPhone and iPad, very easy to use and implement.
https://github.com/50pixels/FPPopover

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top