当用户按下按钮时,我正在调用ViewController作为弹出窗口.视图应具有alpha 0.5的黑色背景.但是视图显示为一秒钟,而不是整个背景变为黑色而没有alpha.知道为什么吗?
这是我的popover电话:
let popOver = storyboard?.instantiateViewController(withIdentifier: "popOver") as! ViewControllerPopOver
popOver.modalPresentationStyle = .popover
self.present(popOver, animated: true, completion: nil)
Run Code Online (Sandbox Code Playgroud)
我正在尝试viewDidLoad()使用以下代码在popovers 函数中设置背景颜色:
self.view.backgroundColor = UIColor.black.withAlphaComponent(0.5)
Run Code Online (Sandbox Code Playgroud) 我想在一个圆圈中订购28件商品.我有一个给定的角度和一个半径,我需要计算我的坐标.有人能帮帮我吗?
所以我有一个带有一行和两列用于桌面视图的超大屏幕.行高取决于文本.我想将图像垂直居中于旁边的文本.
我正在使用带有两列的网格布局,并使用以下代码垂直居中图像:
#jumbotron-introduction {
background-color: white;
}
#p-introduction {
font-size: 16px;
}
#image-introduction {
width: 100%;
}
.vcenter {
display: flex;
align-items: center;
justify-content: center;
}Run Code Online (Sandbox Code Playgroud)
<div class="container">
<div class="jumbotron" id="jumbotron-introduction">
<div class="row">
<div class="col-xs-12 col-md-6 col-sm-6">
<h3>...</h3>
<p id="p-introduction">...</p>
</div>
<div class="col-xs-12 col-md-6 col-sm-6 vcenter">
<img src="Images/..." id="image-introduction">
</div>
</div>
</div>
</div>Run Code Online (Sandbox Code Playgroud)
但没有任何变化,图像仍然位于列的顶部.我也尝试了以下代码:
.vcenter {
display: inline-block;
vertical-align: middle;
}Run Code Online (Sandbox Code Playgroud)
但这是相同的结果,没有任何反应.