【问题标题】:Firemonkey form scaling to all mobile deviceFiremonkey 表单缩放到所有移动设备
【发布时间】:2014-03-27 09:34:59
【问题描述】:

我正在使用 Delphi XE5 开发一个 Android 应用程序,但我在扩展我的设计以修复到 2.8" 和 10.1" 移动设备范围内的所有移动设备时遇到问题。

向我指出任何对此问题的回答将不胜感激,或者举个例子将是最有帮助的。

【问题讨论】:

    标签: delphi mobile scale device


    【解决方案1】:

    我通常做的是使用 alScale Align 属性。这是一个例子:

    FMX:

    object Form1: TForm1
      Left = 0
      Top = 0
      Caption = 'Form1'
      ClientHeight = 426
      ClientWidth = 429
      FormFactor.Width = 320
      FormFactor.Height = 480
      FormFactor.Devices = [dkDesktop]
      DesignerMobile = True
      DesignerWidth = 429
      DesignerHeight = 426
      DesignerDeviceName = ''
      DesignerOrientation = 3
      DesignerOSVersion = ''
      object Layout1: TLayout
        Align = alScale
        Height = 426.000000000000000000
        Width = 139.604690551757800000
      end
      object Layout2: TLayout
        Align = alScale
        Height = 426.000000000000000000
        Position.X = 139.236679077148400000
        Width = 155.230239868164100000
      end
      object Layout3: TLayout
        Align = alScale
        Height = 426.000000000000000000
        Position.X = 293.525726318359400000
        Width = 139.236633300781300000
        object Button1: TButton
          Align = alScale
          Height = 26.625030517578130000
          Position.X = 43.169849395751950000
          Position.Y = 358.227325439453100000
          TabOrder = 0
          Text = 'Button1'
          Width = 71.949905395507810000
        end
      end
    end
    

    考绩:

    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.StdCtrls,
      FMX.Layouts;
    
    type
      TForm1 = class(TForm)
        Layout1: TLayout;
        Layout2: TLayout;
        Layout3: TLayout;
        Button1: TButton;
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.fmx}
    
    end.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-01-21
      • 2019-04-22
      • 2017-09-27
      • 2011-12-18
      • 2016-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多