我使用pip3在ubuntu 16.04上安装了Jupyter Notebook.我可以执行jupyter notebook命令.它将打开并显示当前路径目录的列表.
但我不能创建一个新的笔记本(Python3).它说
保存文件时出现意外错误:Deep Learning/NN/Untitled.ipynb [Errno 13]权限被拒绝:'/ home /ubuntu/.local/share/jupyter/notesbook_secret'
我在较早的版本中使用它来在我的searchBar中获取文本字段...
UITextField *searchField = [self.navigationItem.searchController.searchBar valueForKey:@"_searchField"];
Run Code Online (Sandbox Code Playgroud)
在iOS11中,它仍然可以使用,我可以更改文本(字体,甚至colortcolor),但是我无法设置文本颜色,请教我。
UISearchController *mySearchController = [[UISearchController alloc] initWithSearchResultsController:nil];
mySearchController.searchResultsUpdater = self;
self.navigationItem.searchController = mySearchController;
Run Code Online (Sandbox Code Playgroud)
// mySearchController.hidesNavigationBarDuringPresentation = false; self.navigationItem.hidesSearchBarWhenScrolling = NO;
self.tableView.refreshControl = [[UIRefreshControl alloc] init];
[self.tableView.refreshControl addTarget:self action:@selector(refresh) forControlEvents:UIControlEventValueChanged];
self.navigationItem.title = @"xxxx";
self.navigationController.navigationBar.barTintColor = [UIColor redColor];
UIBarButtonItem *item = [[UIBarButtonItem alloc] initWithTitle:@"reload" style:UIBarButtonItemStylePlain target:self action:@selector(refresh)];
self.navigationItem.rightBarButtonItem = item;
UITextField *txfSearchField = [self.navigationItem.searchController.searchBar valueForKey:@"_searchField"];
txfSearchField.tintColor=[UIColor blueColor];
//this code is no use
txfSearchField.textColor=[UIColor yellowColor];
txfSearchField.backgroundColor=[UIColor whiteColor];
UIView *backgroundview= [[txfSearchField subviews]firstObject ];
backgroundview.backgroundColor=[UIColor whiteColor];
backgroundview.layer.cornerRadius = 8; …Run Code Online (Sandbox Code Playgroud) 由于UILocalNotification在iOS 10中已弃用,因此我已使用UNUserNotification框架更新了本地通知流程。
当应用程序位于前台时,它会使用AVPlayer播放自定义声音,并且可以正常工作。但是在后台模式下,当触发本地通知时,会播放默认的通知声音,而不是自定义声音。
但是,在iOS9中一切正常,使用“ didReceiveLocalNotification”方法的应用程序即使在背景模式下也可以播放自定义声音。
更新1:
我将本地通知设置如下:
let content = UNMutableNotificationContent()
content.title = NSString.localizedUserNotificationStringForKey("reminder!", arguments: nil)
content.body = NSString.localizedUserNotificationStringForKey("Reminder body.", arguments: nil)
if let audioUrl == nil {
content.sound = UNNotificationSound.defaultSound()
} else {
let alertSound = NSURL(fileURLWithPath: self.selectedAudioFilePath)
content.sound = UNNotificationSound(named: alertSound.lastPathComponent!)
}
content.userInfo = infoDic as [NSObject : AnyObject]
content.badge = 1
let trigger = UNTimeIntervalNotificationTrigger(timeInterval: 60, repeats: false)
let identifier = "Reminder-\(date)"
let request = UNNotificationRequest(identifier: identifier, …Run Code Online (Sandbox Code Playgroud) 使用自定义UITableViewCell,我试图更改tableViewCell的“删除”按钮的高度。我已经尝试过此处提供的所有解决方案。
每个人都提到过,在customTableViewCell类中,我们需要重写layoutSubviews方法并进行迭代self.subViews以找到一个应该等于UITableViewCellDeleteConfirmationView的子视图,或者在其他iOS版本中,它是UITableViewCellDeleteConfirmationControl,因此我使用了以下代码:
- (void)layoutSubviews
{
[super layoutSubviews];
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationBeginsFromCurrentState:YES];
[UIView setAnimationDuration:0.0f];
for (UIView *subView in self.subviews) {
NSLog(@"subview: %@", self.subviews);
if([NSStringFromClass([subView class]) rangeOfString:@"Delete"].location != NSNotFound) {
CGRect newFrame = subView.frame;
newFrame.size.height = 87;
subView.frame = newFrame;
}
}
[UIView commitAnimations];
}
Run Code Online (Sandbox Code Playgroud)
但是self.subView只有两种观点
如何在iOS 10+中获取tableViewCell的删除按钮视图?
这是我的视图层次结构: