Giter VIP home page Giter VIP logo

toast-bugfix's People

Contributors

aceisscope avatar alexruperez avatar ayanonagon avatar cjsliuj avatar hakanw avatar ilg avatar lifeofbrian avatar natashatherobot avatar phamquy avatar scalessec avatar stephenwakely avatar wving5 avatar

Watchers

 avatar

toast-bugfix's Issues

Ensure toast still fits on screen after rotation #11

scalessec#11

        // size the message label according to the length of the text
        CGSize maxSizeMessage = CGSizeMake((self.bounds.size.width * CSToastMaxWidth) - imageWidth, self.bounds.size.height * CSToastMaxHeight);

+        //make sure that if we rotate the message will still fit on the screen
+       CGFloat rotatedMaxMessageWidth = (self.bounds.size.height * CSToastMaxWidth) - imageWidth;
+        if (maxSizeMessage.width > rotatedMaxMessageWidth) maxSizeMessage.width = rotatedMaxMessageWidth;

        CGSize expectedSizeMessage = [message sizeWithFont:messageLabel.font constrainedToSize:maxSizeMessage lineBreakMode:messageLabel.lineBreakMode]; 
        messageLabel.frame = CGRectMake(0.0, 0.0, expectedSizeMessage.width, expectedSizeMessage.height);
    }

add style, UIActivatyIndicator to makeToastActivity #102

scalessec#102

- (void)makeToastActivity:(id)position {
    [self makeToastActivity:position style:nil];
}

- (void)makeToastActivity:(id)position style:(CSToastStyle *)style {
    [self makeToastActivity:position style:style indicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
}

- (void)makeToastActivity:(id)position style:(CSToastStyle *)style indicatorStyle:(UIActivityIndicatorViewStyle)indicatorStyle {
    // sanity
    UIView *existingActivityView = (UIView *)objc_getAssociatedObject(self, &CSToastActivityViewKey);
    if (existingActivityView != nil) return;

    CSToastStyle *style = [CSToastManager sharedStyle];
    if (style == nil) {
        style = [CSToastManager sharedStyle];
    }
    .....

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.