我正在研究JTCalendar教程(版本6.1.5)。当我在较小的手机(如iPhone SE)上运行时,选择视图中圆圈的一侧会被剪裁。这是因为单元格大约为45x45点,但选择视图的大小为50x50点,因此太大而无法完全适合单元格。
如何让我的选择视图适合不同大小的日期单元?
如何为选择视图圈获得The system uses no more than NAMEDATALEN-1 bytes of an identifier; longer names can be written in commands, but they will be truncated. By default, NAMEDATALEN is 64 so the maximum identifier length is 63 bytes. If this limit is problematic, it can be raised by changing the NAMEDATALEN constant in src/include/pg_config_manual.h.
的正确值?
答案 0 :(得分:1)
我能够解决这个问题。问题是教程设置了选定视图的大小并将其保留。我做的是
为 self.navigationController?.navigationBar.barTintColor = self.utilities.hexStringToUIColor(hex: "#00b8de")
var imageview2 = UIImage(named: "menulogo")
imageview2 = imageview2?.imageResize(sizeChange: CGSize(width: 25, height: 25))
btnMenu.setImage(imageview2,for:UIControlState.normal)
btnMenu.setTitle("", for: .normal)
// setup the red circle UIView
let redCircleView = UIView(frame: CGRect(x: 0, y: 0, width: 20, height: 20))
redCircleView.backgroundColor = UIColor.red
redCircleView.layer.cornerRadius = view.frame.size.width / 2
// setup the number UILabel
let label = UILabel(frame: CGRect(x: 30, y: 0, width: 20, height: 20))
label.textColor = UIColor.white
label.font = UIFont.systemFont(ofSize: 10)
label.text = "16"
// adding the label into the red circle
redCircleView.addSubview(label)
// adding the red circle into the menu button
btnMenu.addSubview(redCircleView)
在CellView.swift
中,我按如下方式修改了单元格选择:
ViewContoller.swift
这将获取父视图并确定较小的维度。这需要向下舍入。然后,我使用此父视图尺寸来设置CellView的宽度和高度,以及确定角半径。