Registriert seit: 31. Dez 2004
Ort: Stuttgart
4.408 Beiträge
Delphi XE8 Enterprise
|
AW: Fragen zu FMX unter Android
11. Jun 2014, 19:40
Ist vielleicht eine blöde Frage, aber wie hast Du das realisiert? Wenn ich eine zweite Form mit .Show anzeige, dann klappt das nicht 100%. Oder handelst Du das direkt in der DPR?
Ich handel das direkt in der DPR ab, so zum Beispiel :
Delphi-Quellcode:
{$R *.res}
////////////////////////////////////////////////////////////////////////////////
///
/// To check if the app is running on a Pad
///
function IsPad: Boolean;
begin
{$IFDEF IOS}
Result := TUIDevice.Wrap(TUIDevice.OCClass.currentDevice).userInterfaceIdiom = UIUserInterfaceIdiomPad;
{$ENDIF}
{$IFDEF ANDROID}
Result := (MainActivity.getResources.getConfiguration.screenLayout and TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_MASK)
>= TJConfiguration.JavaClass.SCREENLAYOUT_SIZE_LARGE;
{$ENDIF}
end;
////////////////////////////////////////////////////////////////////////////////
///
/// Main Program
///
begin
Application.Initialize;
Application.FormFactor.Orientations := [TFormOrientation.Portrait, TFormOrientation.InvertedPortrait,
TFormOrientation.Landscape, TFormOrientation.InvertedLandscape];
if IsPad then
Application.CreateForm(TPadMainForm, PadMainForm)
else
Application.CreateForm(TPhoneMainForm, PhoneMainForm);
Application.Run;
end.
|
|
Zitat
|