This commit is contained in:
2025-11-03 20:02:11 +08:00
parent cac2f13b88
commit 5af2612ff7
8 changed files with 26 additions and 41 deletions

View File

@@ -11,7 +11,7 @@
@interface HomeVC () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITextView *textView; //
@property (nonatomic, strong) UITableView *tableView; //
@property (nonatomic, strong) BaseTableView *tableView; //
@property (nonatomic, copy) NSArray<NSString *> *items; //
@end
@@ -21,7 +21,6 @@
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
//
CGFloat width = [UIScreen mainScreen].bounds.size.width;
UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, width, 220)];
CGRect frame = CGRectMake(16, 16, width - 32, 188);
@@ -32,20 +31,17 @@
[header addSubview:self.textView];
//
self.tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped];
self.tableView = [[BaseTableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleInsetGrouped];
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.tableView.delegate = self;
self.tableView.dataSource = self;
self.tableView.tableHeaderView = header;
[self.view addSubview:self.tableView];
//
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission") ];
// 便
dispatch_async(dispatch_get_main_queue(), ^{ [self.textView becomeFirstResponder]; });
//
[[KBNetworkManager shared] GET:@"app/config" parameters:nil headers:nil completion:^(id _Nullable jsonOrData, NSURLResponse * _Nullable response, NSError * _Nullable error) {
NSLog(@"====");
}];
@@ -53,9 +49,7 @@
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
//
self.title = KBLocalized(@"home_title");
// items cell
self.items = @[ KBLocalized(@"home_item_lang_test"), KBLocalized(@"home_item_keyboard_permission") ];
[self.tableView reloadData];
}