基本信息
源码名称:fmx横竖屏切换 示例源码
源码大小:0.10M
文件格式:.rar
开发语言:Pascal
更新时间:2018-01-13
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300

本次赞助数额为: 5 元 
   源码介绍
fmx横竖屏切换

fmx横竖屏切换

unit Unit1;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Graphics, FMX.Dialogs,
  FMX.Controls.Presentation, FMX.StdCtrls ;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Button4: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
    procedure Button4Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.fmx}
 uses
 FMX.Platform;

procedure TForm1.Button1Click(Sender: TObject);
var
  AppService: IFMXScreenService;
  AOrientations: TScreenOrientations ;
  ScreenOrientation:TScreenOrientation;
begin
 if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, AppService) then
  ScreenOrientation:=TScreenOrientation.Portrait;
  AOrientations:=  [ScreenOrientation];
  AppService.SetScreenOrientation(AOrientations);
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  AppService: IFMXScreenService;
  AOrientations: TScreenOrientations ;
  ScreenOrientation:TScreenOrientation;
begin
   if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, AppService) then
  ScreenOrientation:=TScreenOrientation.Landscape;
  AOrientations:=  [ScreenOrientation];
  AppService.SetScreenOrientation(AOrientations);

end;

procedure TForm1.Button3Click(Sender: TObject);
var
  AppService: IFMXScreenService;
  AOrientations: TScreenOrientations ;
  ScreenOrientation:TScreenOrientation;
begin
   if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, AppService) then
  ScreenOrientation:=TScreenOrientation.InvertedPortrait;
  AOrientations:=  [ScreenOrientation];
  AppService.SetScreenOrientation(AOrientations);

end;

procedure TForm1.Button4Click(Sender: TObject);

var
  AppService: IFMXScreenService;
  AOrientations: TScreenOrientations ;
  ScreenOrientation:TScreenOrientation;
begin
    if TPlatformServices.Current.SupportsPlatformService(IFMXScreenService, AppService) then
  ScreenOrientation:=TScreenOrientation.InvertedLandscape;
  AOrientations:=  [ScreenOrientation];
  AppService.SetScreenOrientation(AOrientations);

end;

end.