Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS iCL UITableView stylen (https://www.delphipraxis.net/177487-icl-uitableview-stylen.html)

Crocotronic 8. Nov 2013 19:24


iCL UITableView stylen
 
Hallo,
kann mir jemand erklären, wie ich das verdammte UITableView style? Hab hier zwar ein Link, aber verstehe dort nichts.
Den Teil, wie ich Controls mit Core Graphics selber zeichne, hab ich problemlos hinbekommen!
Hier verstehe ich die Vorgehensweise bzw. welche Events ich benutzen muss nicht.

Viele Grüße
Croco

Union 8. Nov 2013 19:43

AW: UITableView stylen
 
Geht es um XCode oder Delphi? Und falls Letzteres, mit welchen Komponenten oder programmierst Du einen eigenen Viewcontroller?

Crocotronic 8. Nov 2013 19:53

AW: UITableView stylen
 
Ups, ganz vergessen: Es geht um die nativen Controls von TMS.

Union 8. Nov 2013 19:56

AW: iCL UITableView stylen
 
Und wieso schaust Du Dir dann ein Xcode-Tutorial an? Versuch doch mal den TMS-Code zu verstehen und das zu ergänzen.

Crocotronic 8. Nov 2013 20:04

AW: iCL UITableView stylen
 
Ich verstehe das Zeug so einigermaßen, nur hier habe ich ein Problem:
Code:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString * CellIdentifier = @"Cell";
    UITableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    NSString * entry;
 
    // START NEW
    if (![cell.backgroundView isKindOfClass:[CustomCellBackground class]]) {
        cell.backgroundView = [[CustomCellBackground alloc] init];
    }
 
    if (![cell.selectedBackgroundView isKindOfClass:[CustomCellBackground class]]) {
        cell.selectedBackgroundView = [[CustomCellBackground alloc] init];
    }
    // END NEW
 
    if (indexPath.section == 0) {
        entry = self.thingsToLearn[indexPath.row];
    } else {
        entry = self.thingsLearned[indexPath.row];
    }
    cell.textLabel.text = entry;
 
    cell.textLabel.backgroundColor = [UIColor clearColor]; // NEW
 
    return cell;
}
Genauer gesagt hier:
Code:
if (![cell.backgroundView isKindOfClass:[CustomCellBackground class]]) {
        cell.backgroundView = [[CustomCellBackground alloc] init];
    }
 
    if (![cell.selectedBackgroundView isKindOfClass:[CustomCellBackground class]]) {
        cell.selectedBackgroundView = [[CustomCellBackground alloc] init];
    }
Hier wird abgefragt, ob die Art der Spalte dem CustomCellBackground entspricht. Nur wo kommt das CustomCellBackground her?

Union 8. Nov 2013 20:16

AW: iCL UITableView stylen
 
Das ist eine von Dir zu erstellende UIVIew-Klasse. Dort realisierst Du dann Events wie drawRect etc. Die Klasse steht bei XCode in "CustomCellBackground.h", deshalb
Code:
#import "CustomCellBackground.h"

Crocotronic 8. Nov 2013 20:44

AW: iCL UITableView stylen
 
Achso, und dieses View ist dann später die Zeile? Ahaaa....

Ah noch eine Frage: In welchem Event kommt der Abschnitt von oben?

Union 8. Nov 2013 20:50

AW: iCL UITableView stylen
 
Steht doch da
Code:
cellForRowAtIndexPath
. Das gibt eine Zelle zurück, so ein bischen wie ein StringGird.Cells. Nur dass es eben NSIndexPath.section und NSIndexPath.Row heißt. Und der kann noch weiter verschachtelt werden, wie ein Baum.

Crocotronic 8. Nov 2013 20:59

AW: iCL UITableView stylen
 
Meine Frage war eher, welches Event ich beim TableView aus der iCL benutzen soll. Ein Event mit dem (oder ähnlichen) Namen "cellForRowAtIndexPath" kann ich nicht finden :gruebel:

Union 8. Nov 2013 21:10

AW: iCL UITableView stylen
 
Ich kenne die iCL nicht. Aber TMS muss ja den UIView irgendwie umgesetzt haben. Musst Du in deren Code suchen. Auch wenn es vielleicht nicht als published property in einen im OI sichtbaren Notify-Event umgesetzt wurde.


Alle Zeitangaben in WEZ +1. Es ist jetzt 12:49 Uhr.
Seite 1 von 2  1 2      

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz