firemonkey开发app(手势gesture)

1、新建multidevic-application工程项目。

2、toolbar+speedbuttonX2+layout-》tabcontrol+gesturemanager+actionlist等组件。

  SpeedButton1.Name := 'SpeedButton1';
  SpeedButton1.Parent := ToolBar1;
  SpeedButton1.Action := PreviousTabAction1;
  SpeedButton1.Align := Left;
  SpeedButton1.StyleLookup := 'arrowlefttoolbutton';
  SpeedButton2.Name := 'SpeedButton2';
  SpeedButton2.Parent := ToolBar1;
  SpeedButton2.Action := NextTabAction1;
  SpeedButton2.Align := Right;
  SpeedButton2.StyleLookup := 'arrowrighttoolbutton';

imagelist组件设置。

tabcontrol属性设置。

tabitem1-4属性设置。0-3

actionlist属性设置。

tabcontrol手势控制代码。

procedure TForm1.TabControl1Gesture(Sender: TObject; const EventInfo: TGestureEventInfo; var Handled: Boolean);
begin
  case EventInfo.GestureID of
    sgiLeft:
      begin
        TabControl1.Previous();
        Handled := True;
      end;
    sgiRight:
      begin
        TabControl1.Next();
        Handled := True;
      end;
  end;

end;
发布了303 篇原创文章 · 获赞 59 · 访问量 21万+

猜你喜欢

转载自blog.csdn.net/winniezhang/article/details/104212947