import UIKit
import SnapKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
let tableView = UITableView(frame: .zero, style: .plain)
let records = ["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. "]
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(Cell.self, forCellReuseIdentifier: "Cell")
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.edges.equalToSuperview()
}
tableView.dataSource = self
tableView.delegate = self
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
records.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "Cell") as! Cell
cell.label.attributedText = NSAttributedString(string: records[indexPath.row], attributes: [.foregroundColor: UIColor.label, .font: UIFont.systemFont(ofSize: 18)])
return cell
}
}
class Cell: UITableViewCell {
let label = MyLabel()
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
contentView.addSubview(label)
label.snp.makeConstraints { make in
make.edges.equalToSuperview().inset(10)
}
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
}
print("layoutSubviews: \(bounds.size), \(preferredMaxLayoutWidth)") if preferredMaxLayoutWidth != bounds.width { print("preferredMaxLayoutWidth is different from bounds.width") preferredMaxLayoutWidth = bounds.width invalidateIntrinsicContentSize() setNeedsDisplay() } else { print("preferredMaxLayoutWidth is same as bounds.width") }
let usedRect = layoutManager.usedRect(for: textContainer)
print("usedRect: \(usedRect)")
return usedRect.size }
} [/code] Ich platziere es in einem UitableViewCell : [code]import UIKit import SnapKit
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
let tableView = UITableView(frame: .zero, style: .plain)
let records = ["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. "]
override func viewDidLoad() { super.viewDidLoad()
tableView.register(Cell.self, forCellReuseIdentifier: "Cell") view.addSubview(tableView) tableView.snp.makeConstraints { make in make.edges.equalToSuperview() } tableView.dataSource = self tableView.delegate = self }
def draw_board():
global turn, board
for col in range(0, 5):
for row in range(0, 6):
rect_bg = pygame.draw.rect(screen, THISTLE, , 0, 10)
rect_inside_border = pygame.draw.rect(screen, BLACK, , 8,...
Ich integriere Admob in meine Flutter -App mit dem Plugin von Google_Mobile_Ads. Belohnte Anzeigen funktionieren gut, aber meine native Anzeige lädt nicht. Ich habe überprüft, ob die AD -IDs korrekt...
Wenn ich einen Bildlauf durchführe, verwende ich den UIView-Animationsblock, um meine Tab-Leiste auszublenden.
Mein UITabBarController ist der Root-View-Controller in einem NavigationController
Dies...
contentControl wird in wpf.
Das ContentControl erstellt. funktioniert. using WpfApp1.Models;
using OpenTK.Graphics.OpenGL;
using OpenTK.Mathematics;
using OpenTK.Wpf;
using System.Windows;
using...