{"id":3926,"date":"2016-06-01T16:07:20","date_gmt":"2016-06-01T08:07:20","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3926"},"modified":"2016-06-07T12:55:51","modified_gmt":"2016-06-07T04:55:51","slug":"ios%e5%bc%80%e5%8f%91-%e4%bd%bf%e7%94%a8-tpopup-%e5%ae%9e%e7%8e%b0%e7%b1%bb%e4%bc%bc-tooltips-%e7%b1%bb%e5%9e%8b%e7%9a%84%e4%bf%a1%e6%81%af%e9%80%9a%e7%9f%a5%e6%98%be%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3926","title":{"rendered":"[iOS\u5f00\u53d1] \u4f7f\u7528 TPopup \u5b9e\u73b0\u7c7b\u4f3c Tooltips \u7c7b\u578b\u7684\u4fe1\u606f\u901a\u77e5\u663e\u793a"},"content":{"rendered":"<p>\u5728\u624b\u673a\u5e94\u7528\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u5019\uff0c\u6211\u4eec\u8981\u7ed9\u7528\u6237\u4e00\u4e9b\u7b80\u5355\u7684\u63d0\u793a\uff0c\u8fd9\u4e9b\u63d0\u793a\u4e0d\u9700\u8981\u7528\u6237\u63d0\u793a\uff0c\u5728\u4e00\u5b9a\u7684\u65f6\u95f4\u4e4b\u540e\uff0c\u5b83\u5c31\u53ef\u4ee5\u81ea\u52a8\u6d88\u5931\u4e86\u3002\u5b9e\u9645\u4e0a\uff0c\u901a\u8fc7 FMX \u800c\u4e0d\u662f\u7cfb\u7edf\u7684\u63a5\u53e3\u5c31\u53ef\u4ee5\u5f88\u7b80\u5355\u7684\u5b9e\u73b0\u8fd9\u4e00\u6548\u679c\u3002\u4e0b\u9762\u7b80\u5355\u8bf4\u4e00\u4e0b\u6b65\u9aa4\uff0c\u4f9b\u5927\u5bb6\u53c2\u8003\uff1a<\/p>\n<ol>\n<li>\u5728\u7a97\u4f53\u4e0a\u653e\u4e00\u4e2a TPopup \u548c TTimer\uff0c\u8bbe\u7f6e TTimer \u7684 Interval \u4e3a 2500 \u6beb\u79d2\uff0c\u5e76\u4e14 Enabled \u9ed8\u8ba4\u4e3a false\u3002<\/li>\n<li>\u5728 TPopup \u4e0a\u653e\u7f6e\u4e00\u4e2a TRectangle \uff0c\u7136\u540e\u5728 TRectangle \u4e0a\u653e\u7f6e\u4e00\u4e2a TLabel\uff0c\u7136\u540e\u8bbe\u7f6e TRectangle \u548c TLabel \u7684\u5bf9\u9f50\u65b9\u5f0f\u4e3a Client\uff0c\u7136\u540e\u4f60\u518d\u6839\u636e\u9700\u8981\u8c03\u6574\u4e0b TRectangle\u7684\u8fb9\u7ebf\u53ca\u586b\u5145\u7684\u989c\u8272\u3001\u900f\u660e\u5ea6\u7b49\u4fe1\u606f\uff0c\u8c03\u6574 TLabel \u7684\u6587\u672c\u5bf9\u9f50\u65b9\u5f0f\u3002<\/li>\n<li>\u63a5\u4e0b\u6765\uff0c\u5b9e\u73b0\u4e00\u4e2a\u51fd\u6570\u6765\u8ba1\u7b97\u8981\u6d88\u606f\u63d0\u793a\u7684\u5185\u5bb9\u7684\u533a\u57df\u5927\u5c0f\uff0c\u5e76\u8c03\u7528\u5f39\u51fa\u7684\u63d0\u793a\u6d88\u606f\u7684\u5e03\u5c40\u4f4d\u7f6e\uff0c\u5982\u679c\u4e0d\u8bbe\u7f6e\u4f4d\u7f6e\uff0c\u5219\u4f1a\u5728\u4f60\u89e6\u63a7\u7684\u4f4d\u7f6e\u9644\u8fd1\u663e\u793a\uff0c\u4e0b\u9762\u662f\u4e00\u6bb5\u53c2\u8003\uff0c\u5176\u4e2d lblMessage \u662f\u4e0a\u9762\u7684 TLabel\uff0cpopMessage \u662f\u4e0a\u9762\u7684 TPopup\uff0ctmMessage \u662f\u4e0a\u9762\u7684 TTimer\u3002\n<pre class=\"lang:delphi decode:true\">procedure TfrmMain.PopHint(const AMsg: String);\r\nvar\r\n  V: Single;\r\n  R: TRectF;\r\nbegin\r\n  R := ClientRect;\r\n  R.Inflate(-10, -10);\r\n  lblMessage.Canvas.MeasureText(R, AMsg, true, [], TTextAlign.Leading,\r\n    TTextAlign.Leading);\r\n  popMessage.Width := R.Width + 20;\r\n  popMessage.Height := R.Height + 20;\r\n  lblMessage.Text := AMsg;\r\n  Application.ProcessMessages;\r\n  popMessage.IsOpen := true;\r\n  tmMessage.Enabled := false;\r\n  tmMessage.Enabled := true;\r\nend;\r\n\r\nprocedure TfrmMain.tmMessageTimer(Sender: TObject);\r\nbegin\r\n  popMessages.IsOpen := false;\r\n  tmMessage.Enabled := false;\r\nend;<\/pre>\n<\/li>\n<li>\u597d\u4e86\uff0c\u73b0\u5728\u5c31\u53ef\u4ee5\u76f4\u63a5\u8c03\u7528 PopHint \u6765\u663e\u793a\u63d0\u793a\u4e86\u3002<\/li>\n<\/ol>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u624b\u673a\u5e94\u7528\u5f00\u53d1\u7684\u8fc7\u7a0b\u4e2d\uff0c\u6709\u65f6\u5019\uff0c\u6211\u4eec\u8981\u7ed9 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[69,8,602],"tags":[629,275],"class_list":["post-3926","post","type-post","status-publish","format-standard","hentry","category-c-builder","category-delphi","category-ios","tag-629","tag-275"],"views":2789,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3926","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3926"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3926\/revisions"}],"predecessor-version":[{"id":3931,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3926\/revisions\/3931"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}