2Pascal-新时代的Pascal

标题: XE8UP1添加View的问题 [打印本页]

作者: 先知三日    时间: 2015-7-13 12:10
标题: XE8UP1添加View的问题
公司测试用的平板是小米的
pp1:326
分辨率:2048*1536
想要自己添加个View,都是根据帮助文档来的

[mw_shl_code=delphi,true]unit MyViews;

interface
const
  MiPAD = 'MIPAD'; // The unique name of the view, it has to be the same name as the one written between <Name></Name> tags of the DevicePreset.xml file.

implementation

uses

  system.Devices, system.Types, system.SysUtils;


type
  TDeviceRec = record
    ID: string;
    DevClass: TDeviceInfo.TDeviceClass;
    MinLogicalSize, MaxLogicalSize: TSize;
    MinPhysicalSize, MaxPhysicalSize: TSize;
    PPI: Integer;
    Exclusive: Boolean;
  end;

const
  DeviceCount = 1;
  Devices: array[0..DeviceCount - 1] of TDeviceRec =(
  (ID: MiPAD; DevClass: TDeviceInfo.TDeviceClass.Tablet;
     MinLogicalSize: (cx: 1024; cy: 768); MaxLogicalSize: (cx: 1024; cy: 768);
     MinPhysicalSize: (cx: 2048; cy: 1536); MaxPhysicalSize: (cx: 2048; cy: 1536); PPI: 326; Exclusive: False)
  );
initialization

  TDeviceinfo.AddDevice(TDeviceinfo.TDeviceClass.Tablet, MiPAD,
    Devices[0].MinPhysicalSize, Devices[0].MinLogicalSize, // MinPhysicalSize(max, min), MinLogicalSize(max, min)
    Devices[0].MaxPhysicalSize, Devices[0].MaxLogicalSize, // MaxPhysicalSize(max,min), MaxLogicalSize(max,min)
    TOSVersion.TPlatform.pfAndroid, Devices[0].PPI,Devices[0].Exclusive); //Select the platform and the pixel density.

finalization

  TDeviceinfo.RemoveDevice(MiPAD); // To unregister the view after unistalling the package.

end.[/mw_shl_code]


FormDesigner中的宽度高度我按1024*768弄的


可是测试程序生成之后用的是Master,而不是我做的这个,是什么问题






欢迎光临 2Pascal-新时代的Pascal (http://2pascal.com/) Powered by Discuz! X3