Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS: UIView in UILabel konvertieren? (https://www.delphipraxis.net/178640-ios-uiview-uilabel-konvertieren.html)

romber 19. Jan 2014 10:32

iOS: UIView in UILabel konvertieren?
 
Hallo!

Wie kann ich eine mit viewWithTag() ermittelte UIView in UILabel konvertieren? In Objective C deklariere ich einfach ein UILabel und initialisiere es mit einer bereits vorhandenen UILabel, die aber zuerst als UIView ermittelt wird:

Code:
UILabel *test = (UILabel *) [cell viewWithTag:1];
In Delphi kann ich die UIView zwar auch mit viewWithTag ermitteln

Delphi-Quellcode:
viewTest := TUIView.Wrap(ACell.contentView.viewWithTag(1));


aber alle Versuche, daraus ein UILabel zu bekommen schlagen fehl.

Wie mach ich das?

Crocotronic 19. Jan 2014 13:40

AW: iOS: UIView in UILabel konvertieren?
 
Ich hätt jetzt auf irgendwie sowas getippt
Delphi-Quellcode:
TUILabel.Wrap(ACell.contentView.viewWithTag(1))

romber 19. Jan 2014 13:46

AW: iOS: UIView in UILabel konvertieren?
 
Zitat:

Zitat von Crocotronic (Beitrag 1244340)
Ich hätt jetzt auf irgendwie sowas getippt
Delphi-Quellcode:
TUILabel.Wrap(ACell.contentView.viewWithTag(1))

Hätte ich auch. Typen sind aber inkompatibel.

Crocotronic 19. Jan 2014 13:51

AW: iOS: UIView in UILabel konvertieren?
 
Wenn du weißt, welches Subview das ist, was du suchst, kannst du folgendes machen:
Delphi-Quellcode:
TUILabel.Wrap(FMyView.subviews.objectAtIndex(1))

romber 19. Jan 2014 13:54

AW: iOS: UIView in UILabel konvertieren?
 
Zitat:

Zitat von Crocotronic (Beitrag 1244343)
Wenn du weißt, welches Subview das ist, was du suchst, kannst du folgendes machen:
Delphi-Quellcode:
TUILabel.Wrap(FMyView.subviews.objectAtIndex(1))

Vielen Dank! Das geht.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:27 Uhr.

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