我想知道为什么var imagePicker = UIImagePickerController()
从imagePicker.delegate = self
到func openGallary()
{
imagePicker.sourceType = UIImagePickerControllerSourceType.photoLibrary
imagePicker.allowsEditing = true
self.present(imagePicker, animated: true, completion: nil)
}
时会垂直变大。我希望它在切换所有图像时保持不变。
我在做什么错,我该如何解决?
代码段
background-image
url/path
url/path2
答案 0 :(得分:1)
.topSession的高度为max-height:100%会根据图像的大小调整大小,因此您要做的是定义类的高度,例如:
.topSection {
padding-top: 20px;
background-image: url("https://d2d00szk9na1qq.cloudfront.net/Product/40a055c9-72b6-4e07-aaa8-0eaf956f297c/Images/Large_0348615.jpg");
width: 100%;
height: 60%;
position: fixed;
}