小说绘上架版本
This commit is contained in:
+21
@@ -0,0 +1,21 @@
|
||||
//
|
||||
// TFAnnouncementController.h
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/14.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TFBasicViewController.h"
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface TFAnnouncementController : TFBasicViewController
|
||||
|
||||
@property (nonatomic ,copy) NSString *titleText;
|
||||
@property (nonatomic ,copy) NSString *contentText;
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
//
|
||||
// TFAnnouncementController.m
|
||||
// TFReader
|
||||
//
|
||||
// Created by 谢腾飞 on 2020/12/14.
|
||||
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||||
//
|
||||
|
||||
#import "TFAnnouncementController.h"
|
||||
|
||||
@interface TFAnnouncementController ()
|
||||
|
||||
@end
|
||||
|
||||
@implementation TFAnnouncementController
|
||||
|
||||
- (void)viewDidLoad
|
||||
{
|
||||
[super viewDidLoad];
|
||||
|
||||
[self initialize];
|
||||
[self createSubviews];
|
||||
|
||||
}
|
||||
- (void)initialize
|
||||
{
|
||||
[self setNavigationBarTitle:self.titleText.length > 0 ? self.titleText:TFLocalizedString(@"公告栏")];
|
||||
self.view.backgroundColor = kWhiteColor;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated
|
||||
{
|
||||
[super viewWillAppear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:Notification_Hidden_Tabbar object:nil];
|
||||
}
|
||||
|
||||
- (void)viewDidDisappear:(BOOL)animated
|
||||
{
|
||||
[super viewDidDisappear:animated];
|
||||
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:Notification_Show_Tabbar object:@"animation"];
|
||||
}
|
||||
|
||||
- (void)viewDidAppear:(BOOL)animated
|
||||
{
|
||||
[super viewDidAppear:animated];
|
||||
|
||||
[self setStatusBarDefaultStyle];
|
||||
}
|
||||
|
||||
- (void)createSubviews
|
||||
{
|
||||
YYTextView *textView = [[YYTextView alloc] init];
|
||||
textView.editable = NO;
|
||||
textView.textColor = kBlackColor;
|
||||
textView.font = kMainFont;
|
||||
[self.view addSubview:textView];
|
||||
|
||||
NSMutableAttributedString *text = [[NSMutableAttributedString alloc] initWithString: self.contentText.length > 0 ? self.contentText:@""];
|
||||
text.lineSpacing = 5;
|
||||
text.font = kMainFont;
|
||||
textView.attributedText = text;
|
||||
|
||||
[textView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(kHalfMargin);
|
||||
make.top.mas_equalTo(PUB_NAVBAR_HEIGHT + kHalfMargin);
|
||||
make.width.mas_equalTo(SCREEN_WIDTH - kMargin);
|
||||
make.height.mas_equalTo(SCREEN_HEIGHT - PUB_NAVBAR_HEIGHT - kHalfMargin);
|
||||
}];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user