Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Cross-Platform-Entwicklung (https://www.delphipraxis.net/91-cross-platform-entwicklung/)
-   -   iOS DPFActivityIndicator zur Laufzeit erzeugen (https://www.delphipraxis.net/176418-dpfactivityindicator-zur-laufzeit-erzeugen.html)

Crocotronic 3. Sep 2013 22:21

DPFActivityIndicator zur Laufzeit erzeugen
 
Hallo,
ich habe ein Problem, und zwar: meine App soll auf iOS als auch auf Windows laufen (was ja seid Franks Idee stylisch wunderbar funktioniert). Nur funtkioniert das nicht, sobald ich die nativen iOS-Controls benutze (logisch). Deshalb habe ich vor, den DPFActivityIndicator nur zu erstellen, wenn die App auf iOS läuft.
Das habe ich mal folgenderweise gemacht:
Delphi-Quellcode:
 {$IFDEF IOS}
 ActivityIndicator1:= TDPFActivityIndicatorView.Create(F_Main);
 ActivityIndicator1.Align:= TAlignLayout.alCenter;
 ActivityIndicator1.Width:= 110;
 ActivityIndicator1.Height:= 110;
 ActivityIndicator1.BackgroundColor:= TAlphaColors.Black;
 ActivityIndicator1.Color:= TAlphaColors.blue;
 ActivityIndicator1.Alpha:= 0.8;

 DPFLabel1:= TDPFLabel(ActivityIndicator1);
 DPFLabel1.Align:= TAlignLayout.alMostBottom;
 DPFLabel1.Position.Y:= 66;
 DPFLabel1.Width:= 110;
 DPFLabel1.Height= 34;
 DPFLabel1.Text:= 'Laden...';
 DPFLabel1.TextColor:= TAlphaColors.White;
 DPFLabel1.TextAlignment:= TDPFTextAlignment.taCenter;
 ActivityIndicator1.StartAnimating;
 {$ENDIF}
Nur funktioniert das nicht, also das Fenster wird nicht angezeigt. Auch ein BringToFront bewirkt nichts.
Irgendwelche Idee?

Viele Grüße
Croco

mkinzler 4. Sep 2013 07:53

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
M.E. fehlt hier jeweils die Angabe des Parents

Crocotronic 4. Sep 2013 11:00

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Bringt leider nichts :|
Delphi-Quellcode:
 ActivityIndicator1:= TDPFActivityIndicatorView.Create(Form1);
 ActivityIndicator1.Parent:= Form1;
 ActivityIndicator1.Align:= TAlignLayout.alCenter;
 ActivityIndicator1.Width:= 110;
 ActivityIndicator1.Height:= 110;
 ActivityIndicator1.BackgroundColor:= TAlphaColors.Black;
 ActivityIndicator1.Color:= TAlphaColors.blue;
 ActivityIndicator1.Alpha:= 0.800000011920929000;

 DPFLabel1:= TDPFLabel.Create(ActivityIndicator1);
 DPFLabel1.Parent:= ActivityIndicator1;
 DPFLabel1.Align:= TAlignLayout.alMostBottom;
 DPFLabel1.Position.Y:= 66;
 DPFLabel1.Width:= 110;
 DPFLabel1.Height:= 34;
 DPFLabel1.Text:= 'Laden...';
 DPFLabel1.TextColor:= TAlphaColors.White;
 DPFLabel1.TextAlignment:= TDPFTextAlignment.taCenter;

 ActivityIndicator1.BringToFront;
 ActivityIndicator1.StartAnimating;

jensw_2000 6. Sep 2013 05:46

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Code:
 ActivityIndicator1:= TDPFActivityIndicatorView.Create(Form1);

 // Ist Form1 unter iOS von UIView abgeleitet?
 // Dann sollte es so etwas in der Art geben ..
 Form1.AddSubView(ActivityIndicator1);  // oder (Form1 as UIView).AddSubView(ActivityIndicator1);
 
 // dann weiter ...
 ActivityIndicator1.Align:= TAlignLayout.alCenter;
 ActivityIndicator1.Width:= 110;
 ActivityIndicator1.Height:= 110;
 ActivityIndicator1.BackgroundColor:= TAlphaColors.Black;
 ActivityIndicator1.Color:= TAlphaColors.blue;
 ActivityIndicator1.Alpha:= 0.800000011920929000;
 ...
 ...
 ActivityIndicator1.StartAnimating;

Crocotronic 6. Sep 2013 11:15

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Mhm, also UIView und ActivityIndicator1 sind inkompatible Typen.

jensw_2000 6. Sep 2013 11:37

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Zitat:

Zitat von Crocotronic (Beitrag 1227390)
Mhm, also UIView und ActivityIndicator1 sind inkompatible Typen.

Dann scheint Dein TDPFActivityIndicatorView nicht vom Typ UIActivityIndicator zu sein.
Bin dann raus ...

Crocotronic 7. Sep 2013 10:23

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Hat vielleicht noch jemand eine Idee?

baeckerg 11. Sep 2013 12:17

AW: DPFActivityIndicator zur Laufzeit erzeugen
 
Poste dein Problem mal in SourceForge? Babak nimmt sich eigentlich immer die Zeit diese probleme anzuschauen bzw. zu beheben.

Ich hatte mit alCenter auch Probleme. alContent hat bei mir geholfen


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:24 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