Comments (5)
Why are you compiling with the 6.1 SDK? In your project settings you should always use the most recent iOS SDK as your base SDK, and then drop your deployment target to whatever iOS version you want to support (Toast will work back to at least iOS5, maybe even iOS 4.3 but I haven't tried it recently).
from toast.
It is a requirement :( but thanks for the advice ;)
from toast.
@gaztesk, if that's the case, just make this change and everything will work when building for the 6.1 SDK.
Change this method:
- (CGSize)sizeForString:(NSString *)string font:(UIFont *)font constrainedToSize:(CGSize)constrainedSize lineBreakMode:(NSLineBreakMode)lineBreakMode {
if ([string respondsToSelector:@selector(boundingRectWithSize:options:attributes:context:)]) {
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = lineBreakMode;
NSDictionary *attributes = @{NSFontAttributeName:font, NSParagraphStyleAttributeName:paragraphStyle};
CGRect boundingRect = [string boundingRectWithSize:constrainedSize options:NSStringDrawingUsesLineFragmentOrigin attributes:attributes context:nil];
return CGSizeMake(ceilf(boundingRect.size.width), ceilf(boundingRect.size.height));
}
return [string sizeWithFont:font constrainedToSize:constrainedSize lineBreakMode:lineBreakMode];
}
to this:
- (CGSize)sizeForString:(NSString *)string font:(UIFont *)font constrainedToSize:(CGSize)constrainedSize lineBreakMode:(NSLineBreakMode)lineBreakMode {
return [string sizeWithFont:font constrainedToSize:constrainedSize lineBreakMode:lineBreakMode];
}
from toast.
It works like a charm!! :) Thank you very much @scalessec
from toast.
Thanks. worked for me too ๐
from toast.
Related Issues (20)
- Hello, can you add animation styles to toast?
- CSToastPositionBottom display not correct running in iPhone X
- Toast appears behind keyboard, not visible to user HOT 1
- how to bind toast in RoboVM
- The position of activity view is not right HOT 1
- Xcode 10 error HOT 2
- Remove existing Toast HOT 1
- Problem on creating loading view with Toast
- Is there a way to block background view?
- ้ฎ็ไผๆกไฝ HOT 2
- Could not find module 'Toast_Swift' for target 'armv7-apple-ios'; found: arm64, arm64-apple-ios HOT 1
- Toast not working HOT 1
- makeToast got error HOT 1
- Toast is always showing at bottom
- can you add a setting accessibility?
- feature request: verticalOffset(s)
- Hello
- Is it possible to change the size (width height) of the toast?
- how to change activity color
- Privacy manifest required by Apple HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toast.