Einzelnen Beitrag anzeigen

Benutzerbild von RWarnecke
RWarnecke

Registriert seit: 31. Dez 2004
Ort: Stuttgart
4.408 Beiträge
 
Delphi XE8 Enterprise
 
#21

AW: Fragen zu FMX unter Android

  Alt 11. Jun 2014, 18: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.
Rolf Warnecke
App4Mission
  Mit Zitat antworten Zitat