注意:屏幕截图取自早期版本的iOS
码:
override func viewWillAppear(animated: Bool) {
// Creates image of the Button
let imageCameraButton: UIImage! = UIImage(named: "cameraIcon")
// Creates a Button
let cameraButton = UIButton(type: .Custom)
// Sets width and height to the Button
cameraButton.frame = CGRectMake(0.0, 0.0, imageCameraButton.size.width, imageCameraButton.size.height);
// Sets image to the Button
cameraButton.setBackgroundImage(imageCameraButton, forState: .Normal)
// Sets the center of the Button to the center of the TabBar
cameraButton.center = self.tabBar.center
// Sets an action to the Button
cameraButton.addTarget(self, action: "doSomething", forControlEvents: …Run Code Online (Sandbox Code Playgroud) 当一个条目进入UITextField时,它启用了安全文本输入.输入的最后一个字符会在一秒左右的时间内进行简短预览.
我也想禁用它.因此,只要输入字符,就会出现没有预览的黑点.
在尝试部署我的 AWS Lambda 函数时在我的 Stacktrace 上出现此错误
(python-dateutil 2.8.1 (/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages), Requirement.parse('python-dateutil<2.7.0'), {'zappa'})
Calling deploy for stage development..
Oh no! An error occurred! :(
==============
Traceback (most recent call last):
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/cli.py", line 2778, in handle
sys.exit(cli.handle())
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/cli.py", line 512, in handle
self.dispatch_command(self.command, stage)
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/cli.py", line 549, in dispatch_command
self.deploy(self.vargs['zip'])
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/cli.py", line 709, in deploy
self.zappa.create_iam_roles()
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/core.py", line 2557, in create_iam_roles
role, credentials_arn = self.get_credentials_arn()
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/zappa/core.py", line 2536, in get_credentials_arn
self.credentials_arn = role.arn
File "/Users/supratik/.local/share/virtualenvs/api_sourcer-sM-JSZy3-/Users/supratik/.pyenv/shims/python/lib/python3.6/site-packages/boto3/resources/factory.py", line 339, …Run Code Online (Sandbox Code Playgroud) 我已经以编程方式创建了一个工具栏,我已经添加了一个UIBarButtonItem.
这是目前的样子:
我希望按钮有一个边框和一个角半径(弯角).如何实施?
UIBarButtonItem实现代码:
let okBarBtn = UIBarButtonItem(barButtonSystemItem: UIBarButtonSystemItem.Done, target: self, action: "donePressed:")
Run Code Online (Sandbox Code Playgroud)