android delphi xe7 判断横竖屏

procedure TForm2.lst1Resize(Sender: TObject);
  var
    i:Integer;
begin
  if SharedActivityContext.getResources.getConfiguration.orientation = 1 then
  begin
    for i := 0 to lst1.Count-1 do
    begin
      lst1.ItemByIndex(i).StyleLookup := 'listboxitembottomdetail';
      Application.ProcessMessages;
    end;
  end
  else
  if SharedActivityContext.getResources.getConfiguration.orientation = 2 then
  begin
    for i := 0 to lst1.Count-1 do
    begin
      lst1.ItemByIndex(i).StyleLookup := 'listboxitemrightdetail';
      Application.ProcessMessages;
    end;
  end;
end;

参考资料:

android如何判断当前是横屏还是竖屏

https://zhidao.baidu.com/question/1732213032462614907.html

Android判断屏幕是横屏或是竖屏的简单实现方法

http://www.jb51.net/article/52851.htm

判断程序是横屏竖屏的表达式

http://blog.csdn.net/landy200666/article/details/78178244

Delphi XE之路(5)让应用程序禁止竖屏(只显示横屏)

http://blog.csdn.net/5201314/article/details/42081099

delphi xe 横屏竖屏的管理

http://www.delphitop.com/html/FMX/2808.html

 

补充:按钮,编辑框,,,这些组件在 Delphi7 有 left top 等属性,但是,换了Delphi Xe7就没有这些属性了,奇怪。。。

Delphi种控件的.left属性是用来标识什么的? 

https://zhidao.baidu.com/question/166117812.html

posted @ 2017-10-21 22:37  stma  阅读(304)  评论(0)    收藏  举报