Skip to content
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

Added support for iOS7 appearance. #51

Closed
wants to merge 7 commits into from
Closed

Conversation

klofberg
Copy link

@klofberg klofberg commented Nov 8, 2013

Allows for setting barTintColor and tintColor to change the look of the Reader.
Example:

ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
[readerViewController setBarTintColor:[UIColor colorWithRed:0.1 green:0.3 blue:0.8 alpha:0.9]];
readerViewController.view.tintColor = [UIColor colorWithWhite:1 alpha:1];

This sets both the toolbar and pagebar background color. The buttons and the Done-button text automatically changes color to the tintColor of the ReaderViewController.

iOS 6 still uses the old appearance.

iOS 6 still uses the old appearance.
Also supports setting barTintColor and tintColor. The buttons and text
changes color to the tintColor.
@cobola
Copy link

cobola commented Nov 8, 2013

how to set this?

it seems still not support ios7

image

@AL333Z
Copy link

AL333Z commented Nov 8, 2013

How to set tint color for buttons?

schermata 08 nov 2013 16 11 18 simulatore ios

@klofberg
Copy link
Author

klofberg commented Nov 8, 2013

You set the tintColor of the ReaderViewController.view instance. This sets the color of all the buttons.

ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];
readerViewController.view.tintColor = [UIColor colorWithWhite:1 alpha:1];

@klofberg
Copy link
Author

klofberg commented Nov 8, 2013

Cobola: I will have a look at why it's not working.

@klofberg
Copy link
Author

klofberg commented Nov 8, 2013

Cobola: It works for me. Are you using this pull request? The original version of Reader (https://github.com/vfr/Reader) hasn't accepted this pull request yet. The fork at https://github.com/klofberg/Reader is the one that has the iOS7 support.

@cobola
Copy link

cobola commented Nov 9, 2013

it works fine in your sample project

image

my project use xib ,my plist is like this

in other code i use this method to support ios7

if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7) {
self.view.bounds = CGRectMake(0, -20, self.view.frame.size.width, self.view.frame.size.height );
UIGraphicsBeginImageContext(self.view.frame.size);
[[UIImage imageNamed:@"ios7bg2.png"] drawInRect:CGRectMake(0, -20, self.view.frame.size.width, self.view.frame.size.height )];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
self.view.backgroundColor = [UIColor colorWithPatternImage:image];
}

I use the reader like this

ReaderDocument *document = [ReaderDocument withDocumentFilePath:path password:phrase];

if (document != nil) // Must have a valid ReaderDocument object in order to proceed with things
{
    ReaderViewController *readerViewController = [[ReaderViewController alloc] initWithReaderDocument:document];

    readerViewController.delegate = self; // Set the ReaderViewController delegate to self
    [self.mController presentModalViewController:readerViewController animated:YES];



    [readerViewController release]; // Release the ReaderViewController
}

@klofberg
Copy link
Author

klofberg commented Nov 9, 2013

Cobola: I can't reproduce your problem. I use the same method to detect iOS 7 as you do ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7). I have also tried setting the same values in plist as you have.

Shows a back button instead of Done when contained in a navigation
controller.
@vfr vfr closed this Sep 16, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants