-
Notifications
You must be signed in to change notification settings - Fork 714
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toast's title is not alignment center #53
Comments
Ditto - there should be a way to center-align the title; on short messages it's probably fine as is, on longer messages it looks ugly. |
Please help me how i can add text center alignment. This is urgent issue for me. |
@adams0917 I'm finishing up a new version of Toast (3.0) that supports custom styling like this. If you want to try it now, here's the branch: https://github.com/scalessec/Toast/tree/experimental/3.0 Here's how you do it with Toast 3.0: CSToastStyle *style = [[CSToastStyle alloc] initWithDefaultStyle];
style.titleAlignment = NSTextAlignmentCenter;
[self.view makeToast:@"This is a piece of toast."
duration:3.0
position:CSToastPositionBottom
style:style]; If you want the title always be centered for all toast views you can just do this: CSToastStyle *style = [[CSToastStyle alloc] initWithDefaultStyle];
style.titleAlignment = NSTextAlignmentCenter;
// set as the default style for all toast views going forward
[CSToastManager setSharedStyle:style]; Then you could just pass Please keep in mind though that the |
Thanks for your reply. But there is only 2.4 version i cocoapods. Is it support Center alignment (2.4 version)? |
No, you'll have to wait until next week if you want to use CocoaPods. You could hack 2.4 to support center alignment by changing line 303 in |
3.0 is now available in CocoaPods. I have a few more updates that I'm going to release in 3.1 later this week. |
Hey Charles, just a heads up, setting One way to fix this is to set |
Hello, i work on iOS 8.1 and test on device.
Toast's title is not alignment center, please help me. Thanks advance!
Here is my code:
Here is image:
The text was updated successfully, but these errors were encountered: