Bir uygulama geliştirmeyi yeni bitirdim ve telefonuma yüklemeye karar verdim. Ardından, masa görünümlerimin telefonumda farklı olduğunu gördüm!Tablo görünümü hücrelerim neden telefonumda bu kadar büyük, ancak simülatörde değil?
Bu, görülmesi gereken şeydir. (Simülatörü)
Bu benim gördün şudur: (My Phone)
Gördüğünüz gibi, üzerinde "artık" benim telefon bakmak tablo görünümünde hücreleri benim Telefon, ama simülatörde normal görünüyor. Bunun neden olduğunu anlamıyorum. Nedenini söyler misin?
Telefonum, iOS 8.1.2 çalıştıran bir iPhone 6s Plus sürümüdür. Benim Simülatörü, bu yeniden film şeridine bir tablo görünümü denetleyicisi ekleyin ve prototip hücrede bu şeyleri koymak için
iOS 9.3 çalıştıran iPhone 6s Plus:
nerede siyah sınır bir görüntü görüntüsüdür.
Ve sonra, bildiğiniz gibi, tablo görünümünde yaptığım gibi bazı hücreleri koyun. https://github.com//Sweeper777/ColorBible
indirme Xcode: Eğer yineleyemiyorsa
class ColorSchemeController: UITableViewController {
var color: UIColor!
override func viewDidLoad() {
super.viewDidLoad()
}
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 5
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case 0...2:
return 3
case 3:
var h: CGFloat = 0
color.getHue(&h, saturation: nil, brightness: nil, alpha: nil)
if h == 0 {
return 3
}
return 5
case 4:
return 2
default:
return 0
}
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell1", forIndexPath: indexPath)
let imageView = cell.viewWithTag(1)! as! UIImageView
let label = cell.viewWithTag(2)! as! UILabel
func setColor(color: UIColor) {
imageView.backgroundColor = color
label.text = color.hexDescription()
}
switch indexPath.section {
case 0:
switch indexPath.row {
case 0:
setColor(self.color)
case 1:
setColor(self.color.rotateHueByDegrees(120))
case 2:
setColor(self.color.rotateHueByDegrees(-120))
default:
assert(false)
}
case 1:
switch indexPath.row {
case 0:
setColor(self.color)
case 1:
setColor(self.color.rotateHueByDegrees(150))
case 2:
setColor(self.color.rotateHueByDegrees(-150))
default:
assert(false)
}
case 2:
switch indexPath.row {
case 0:
setColor(self.color)
case 1:
setColor(self.color.rotateHueByDegrees(30))
case 2:
setColor(self.color.rotateHueByDegrees(-30))
default:
assert(false)
}
case 3:
switch indexPath.row {
case 0:
setColor(self.color)
case 1:
var h: CGFloat = 0
color.getHue(&h, saturation: nil, brightness: nil, alpha: nil)
if h == 0 {
var v: CGFloat = 0
self.color.getHue(nil, saturation: nil, brightness: &v, alpha: nil)
if v <= 0.1 {
setColor(self.color.incrementValueBy(0.1))
} else {
setColor(self.color.incrementValueBy(-0.1))
}
break
}
var s: CGFloat = 0
self.color.getHue(nil, saturation: &s, brightness: nil, alpha: nil)
if s <= 0.1 {
setColor(self.color.incrementSaturationBy(0.1))
} else {
setColor(self.color.incrementSaturationBy(-0.1))
}
case 2:
var h: CGFloat = 0
color.getHue(&h, saturation: nil, brightness: nil, alpha: nil)
if h == 0 {
var v: CGFloat = 0
self.color.getHue(nil, saturation: nil, brightness: &v, alpha: nil)
if v >= 0.9 {
setColor(self.color.incrementValueBy(-0.2))
} else {
setColor(self.color.incrementValueBy(0.2))
}
break
}
var s: CGFloat = 0
self.color.getHue(nil, saturation: &s, brightness: nil, alpha: nil)
if s >= 0.9 {
setColor(self.color.incrementSaturationBy(-0.2))
} else {
setColor(self.color.incrementSaturationBy(0.2))
}
case 3:
var v: CGFloat = 0
self.color.getHue(nil, saturation: nil, brightness: &v, alpha: nil)
if v <= 0.1 {
setColor(self.color.incrementValueBy(0.1))
} else {
setColor(self.color.incrementValueBy(-0.1))
}
case 4:
var v: CGFloat = 0
self.color.getHue(nil, saturation: nil, brightness: &v, alpha: nil)
if v >= 0.9 {
setColor(self.color.incrementValueBy(-0.2))
} else {
setColor(self.color.incrementValueBy(0.2))
}
default:
assert(false)
}
case 4:
switch indexPath.row {
case 0:
setColor(self.color)
case 1:
setColor(self.color.rotateHueByDegrees(180))
default:
assert(false)
}
default:
assert(false)
}
return cell
}
override func tableView(tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
switch section {
case 0:
return "Triadic"
case 1:
return "Split Complements"
case 2:
return "Analogous"
case 3:
return "Monochromatic"
case 4:
return "Complements"
default:
return nil
}
}
}
, burada github link: Burada
İhtiyacınız ihtimale tablo görünümünde kodudur proje ve telefonunuzda çalıştırın.
Çok teşekkür ederim! İşe yarıyor! – Sweeper