{"id":3525,"date":"2016-01-30T23:31:50","date_gmt":"2016-01-30T15:31:50","guid":{"rendered":"http:\/\/blog.qdac.cc\/?p=3525"},"modified":"2016-01-30T23:34:27","modified_gmt":"2016-01-30T15:34:27","slug":"delphi-fmxui%e5%b8%83%e5%b1%80%e7%bb%84%e4%bb%b6%e7%ae%80%e4%bb%8b","status":"publish","type":"post","link":"https:\/\/blog.qdac.cc\/?p=3525","title":{"rendered":"[Delphi] FMXUI\u5e03\u5c40\u7ec4\u4ef6\u7b80\u4ecb"},"content":{"rendered":"<p>\u7ec8\u4e8e\u71ac\u8fc7\u4e86\u4eca\u5e74\u7684\u6700\u540e\u4e00\u5929\u73ed\uff0c\u54e5\u4eec\u6000\u7740\u5174\u594b\uff0c\u4e0b\u73ed\u4e86\u8d76\u7d27\u53bb\u653e\u677e\u4e86\u4e00\u4e0b\uff0c\u518d\u5403\u7897\u70ed\u547c\u547c\u7684\u725b\u8089\u9762\uff0c\u56de\u6765\u6d17\u4e2a\u70ed\u6c34\u6fa1\uff0c\u611f\u89c9\u592a\u8212\u670d\u4e86\u3002<\/p>\n<p>\u5f53\u7136\u4e86\uff0c\u8fd9\u4e48\u91cd\u8981\u7684\u65e5\u4e86\uff0c\u4e0d\u80fd\u5fd8\u4e86\u5199\u7bc7\u6587\u7ae0\uff0c\u4ecb\u7ecd\u4e0b\u6700\u8fd1\u6574\u7684\u8fd9\u4e2a\u57fa\u7840UI\u5e93\uff0c\u4e0d\u80fd\u987e\u7740\u81ea\u4e2a\u513f\u8212\u670d\u4e86\uff0c\u8981\u8ba9\u5927\u5bb6\u4e5f\u5f00\u5f00\u5fc3\u5fc3\u624d\u5bf9\u5427\uff1f\u54c8\uff0c\u987a\u4fbf\u5404\u4f4d\u8d70\u8fc7\u8def\u8fc7\u7684\u6ee1\u5929\u795e\u4f5b\u62dc\u4e2a\u65e9\u5e74\uff0c\u795d\u5927\u5bb6\u65b0\u6625\u5feb\u4e50\uff0c\u606d\u559c\u53d1\u8d22\uff01\uff08\u597d\u5427\uff0c\u6211\u8fd8\u60f3\u8bf4\uff1a\u7ea2\u5305\u62ff\u6765&#8230;)<\/p>\n<p>\u597d\u4e86\uff0c\u4eca\u5929\u6211\u4eec\u6765\u4ecb\u7ecd\u4e0bFMXUI\u4e2d\u7684\u4e09\u5927\u6740\u5668\uff1aTView\u3001TLinearLayout\u3001TRelativeLayout\u3002<\/p>\n<p><strong>\u3010\u540d\u8bcd\u5b9a\u4e49\u3011<\/strong><\/p>\n<p><strong>\u975e\u5e03\u5c40\u7ec4\u4ef6<\/strong>\uff1a \u7ec4\u4ef6\u540d\u4e0d\u662f\u4ee5Layout\u7ed3\u5c3e\u7684\u7ec4\u4ef6\uff0cDelphi\u81ea\u5e26\u7684Panel\u3001Form\u7b49\u5728\u8fd9\u91cc\u90fd\u4e0d\u5c5e\u4e8e\u5e03\u5c40\u7ec4\u4ef6\u3002<\/p>\n<p><strong>\u89c6\u56fe<\/strong>\uff1a \u5373\u53ef\u4ee5\u8ba9\u7528\u6237\u770b\u5230\u7684\u56fe\u5f62\u754c\u9762\u3002TView\u672c\u8eab\u5c31\u662f\u4e00\u4e2a\u89c6\u56fe\uff0c\u4efb\u4f55\u57fa\u4e8eTView\u7684\u7ec4\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u770b\u4f5c\u4e00\u4e2a\u89c6\u56fe\u3002\uff08\u5f53\u7136\uff0c\u89c6\u56fe\u4e0d\u4e00\u5b9a\u90fd\u53ef\u89c1\uff0c\u6bd4\u5982Visible\u4e3aFalse\u65f6\uff0c\u6216\u8d85\u51fa\u663e\u793a\u533a\u57df\u65f6\uff09<\/p>\n<p><strong>\u5bb9\u5668<\/strong>\uff1a \u7ec4\u4ef6\u7684\u7236\u7ea7\u7ec4\u4ef6\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3527\" src=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/01\/background.png\" alt=\"background\" width=\"300\" height=\"450\" srcset=\"https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/01\/background.png 300w, https:\/\/blog.qdac.cc\/wp-content\/uploads\/2016\/01\/background-200x300.png 200w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n<p><strong>\u4e00\u3001 TView<\/strong><\/p>\n<p>\u5728FMXUI\u4e2d\uff0cTView\u662f\u4e07\u7269\u4e4b\u6839\u672c\uff0c\u6240\u6709\u7684\u7ec4\u4ef6\u90fd\u4f1a\u57fa\u4e8e\u6b64\u3002TView\u5b9e\u73b0\u4e86IView\u63a5\u53e3\uff0c\u57fa\u4e8eTControl\u7c7b\u3002\u540c\u5b66\u4eec\u53ef\u4ee5\u5728\u4efb\u4f55\u7ec4\u4ef6\u4e0a\u5b9e\u73b0IView\u63a5\u53e3\uff0c\u4ee5\u4fbf\u63a5\u53d7\u5e03\u5c40\u63a7\u4ef6\u7684\u6307\u6325\u3002<\/p>\n<p><strong>\u3010\u5c5e\u6027\u8bf4\u660e\u3011<\/strong><\/p>\n<p>\uff08\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5217\uff09\uff1a<\/p>\n<p>AdjustViewBounds<\/p>\n<p>\u5e03\u5c14\u578b\uff0c\u662f\u5426\u5141\u8bb8\u6839\u636eMaxWidth, MaxHeight, MinWidth, MinHeight\u5c5e\u6027\u6765\u9650\u5236\u7ec4\u4ef6\u5927\u5c0f\uff0c\u9ed8\u8ba4\u4e3aTrue\u3002<\/p>\n<p>Align<\/p>\n<p>\u7ec4\u4ef6\u76f8\u5bf9\u4e8e\u5bb9\u5668\u7684\u5bf9\u9f50\u65b9\u5f0f\u3002\u5f53\u5bb9\u5668\u4e3a\u975e\u5e03\u5c40\u7ec4\u4ef6\u65f6\u6709\u6548\uff0c\u5728\u90e8\u5206\u5e03\u5c40\u7ec4\u4ef6\u4e2d\u6709\u6548\uff0c\u4f46\u4e0d\u5efa\u8bae\u4f7f\u7528\u3002<\/p>\n<p>Anchors<\/p>\n<p>\u7ec4\u4ef6\u5728\u5bb9\u5668\u4e2d\u7684\u7f29\u653e\u548c\u5b9a\u4f4d\u65b9\u5f0f\u3002\u5f53\u5bb9\u5668\u4e3a\u975e\u5e03\u5c40\u7ec4\u4ef6\u65f6\u6709\u6548\u3002<\/p>\n<p>Background<\/p>\n<p>\u89c6\u56fe\u80cc\u666f\u3002\u89c6\u56fe\u80cc\u666f\u662f\u4e00\u4e2aTDrawable\u5bf9\u8c61\uff0c\u53ef\u901a\u8fc7\u8bbe\u7f6e\u6b64\u5c5e\u6027\u7684\u5b50\u9879\uff0c\u6765\u5b9e\u73b0\u4e0d\u540c\u7684\u663e\u793a\u6548\u679c\uff0c\u8be6\u89c1TDrawable\u7684\u5c5e\u6027\u8bf4\u660e\u3002<\/p>\n<p>Clickable<\/p>\n<p>\u662f\u5426\u54cd\u5e94\u70b9\u51fb\u4e8b\u4ef6\u3002\u540cHitTest\u5c5e\u6027\u3002\u9ed8\u8ba4\u4e3aFalse\u3002<\/p>\n<p>ClipChildren<\/p>\n<p>\u662f\u5426\u526a\u5207\u8d85\u51fa\u7ec4\u4ef6\u53ef\u89c6\u533a\u57df\u7684\u56fe\u5f62\u8f93\u51fa\u3002\u9ed8\u8ba4\u4e3aTrue\u3002\u8bbe\u7f6e\u4e3aFalse\u65f6\uff0c\u663e\u793a\u6548\u679c\u53ef\u80fd\u4f1a\u8d85\u51fa\u4f60\u7684\u8bbe\u60f3\u3002<\/p>\n<p>Gravity<\/p>\n<p>\u7ec4\u4ef6\u672c\u8eab\u4f5c\u4e3a\u5bb9\u5668\u65f6\uff0c\u5185\u90e8\u7684\u91cd\u529b\u3002\u4e5f\u5c31\u662f\u5b50\u7ec4\u4ef6\u7684\u4f4d\u4e8e\u5bb9\u5668\u7684\u4f4d\u7f6e\u3002Gravity\u662f\u679a\u4e3e\u578b\uff1a<\/p>\n<ul>\n<li>None, \u9ed8\u8ba4\u4f4d\u7f6e\uff0c\u4e0d\u81ea\u52a8\u8c03\u6574<\/li>\n<li>LeftTop, \u5de6\u4e0a\u89d2<\/li>\n<li>LeftBottom, \u5de6\u4e0b\u89d2<\/li>\n<li>RightTop, \u53f3\u4e0a\u89d2<\/li>\n<li>RightBottom, \u53f3\u4e0b\u89d2<\/li>\n<li>CenterVertical, \u5782\u76f4\u5c45\u4e2d\uff08\u53ef\u5de6\u53f3\u79fb\u52a8\uff09<\/li>\n<li>CenterHorizontal, \u6c34\u5e73\u5c45\u4e2d\uff08\u53ef\u4e0a\u4e0b\u79fb\u52a8\uff09<\/li>\n<li>CenterHBottom, \u5e95\u90e8\u6c34\u5e73\u5c45\u4e2d<\/li>\n<li>CenterVRight, \u9760\u53f3\u5782\u76f4\u5c45\u4e2d<\/li>\n<li>Center, \u5b8c\u5168\u5c45\u4e2d<\/li>\n<\/ul>\n<p>HeightSize<\/p>\n<p>\u7ec4\u4ef6\u9ad8\u5ea6\u8c03\u8282\u65b9\u5f0f\uff0cWrapContent \u9ed8\u8ba4\uff0c\u968f\u5185\u5bb9\u51b3\u5b9a\uff1b FillParent\uff0c\u586b\u5145\u5bb9\u5668\u3002\u4e00\u822c\u5728\u5bb9\u5668\u662fTLinearLayout\u65f6\u6709\u6548\u3002<\/p>\n<p>Layout<\/p>\n<p>\u76f8\u5bf9\u5e03\u5c40\u5c5e\u6027\u3002\u5f53\u5bb9\u5668\u662fTRelativeLayout\u76f8\u5bf9\u5e03\u5c40\u65f6\u6709\u6548\u3002Layout\u662f\u4e00\u4e2aTViewLayout\u5bf9\u8c61\uff0c\u8be6\u8bf7\u53c2\u8003TViewLayout\u5c5e\u6027\u8bf4\u660e\u3002<\/p>\n<p>Margin<\/p>\n<p>\u5e03\u5c40\u65f6\u4e0e\u5176\u5b83\u7ec4\u4ef6\u56db\u5468\u7684\u8ddd\u79bb\u3002\u6b64\u5c5e\u6027\u662f\u4e00\u4e2a\u5b57\u7b26\u4e32\u5f62\u5f0f\u7684\u6d6e\u70b9\u6570\uff0c\u7528\u4e8e\u4e00\u6b21\u8bbe\u7f6eMargins\u7684\u56db\u8fb9\u4e3a\u76f8\u540c\u7684\u5927\u5c0f\u3002<\/p>\n<p>Margins<\/p>\n<p>\u5e03\u5c40\u65f6\u4e0e\u5176\u5b83\u7ec4\u4ef6\u7684\u8ddd\u79bb\u3002<\/p>\n<p>MaxHeight\u3001MaxWidth\u3001MinHeight\u3001MinWidth<\/p>\n<p>\u7ec4\u4ef6\u7684\u6700\u5927\u9ad8\u5ea6\u3001\u6700\u5927\u5bbd\u5ea6\u3001\u6700\u5c0f\u9ad8\u5ea6\u3001\u6700\u5c0f\u5bbd\u5ea6\u3002\u5f53AdjustViewBounds\u4e3aTrue\u65f6\u6709\u6548\u3002<\/p>\n<p>Opacity<\/p>\n<p>\u7ec4\u4ef6\u7684\u900f\u660e\u5ea6\u3002<\/p>\n<p>Padding<\/p>\n<p>\u7ec4\u4ef6\u5185\u5bb9\u7559\u767d\u5927\u5c0f\u3002<\/p>\n<p>Paddings<\/p>\n<p>\u7ec4\u4ef6\u5185\u5bb9\u56db\u5468\u7559\u767d\u5927\u5c0f\u3002\u4f1a\u81ea\u52a8\u8bbe\u7f6ePadding\u7684\u56db\u8fb9\u4f1a\u76f8\u540c\u7684\u503c\u3002<\/p>\n<p>ParentView<\/p>\n<p>\u5bb9\u5668\u89c6\u56fe\u3002\u5f53\u5bb9\u5668\u662f\u5b9e\u73b0\u4e86IViewGroup\u63a5\u53e3\u65f6\u5b58\u5728\u3002<\/p>\n<p>ViewState<\/p>\n<p>\u89c6\u56fe\u72b6\u6001\u3002\u53ef\u540c\u65f6\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u503c\uff1a<\/p>\n<p>None {\u6b63\u5e38}, Pressed {\u5df2\u6309\u4e0b}, Focused {\u5df2\u53d6\u5f97\u7126\u70b9}, Hovered {\u5df2\u60ac\u505c}, Selected{\u5df2\u9009\u4e2d}, Checked{\u5df2\u590d\u9009}, Enabled{\u5df2\u7981\u7528}, Activated{\u5df2\u6fc0\u6d3b}\u3002<\/p>\n<p>Weight<\/p>\n<p>\u89c6\u56fe\u5728\u7ebf\u6027\u5e03\u5c40\u65f6\uff0c\u57fa\u5bbd\u5ea6\u6216\u9ad8\u5ea6\u5728\u5bb9\u5668\u4e2d\u6240\u5360\u7684\u5927\u5c0f\u6bd4\u4f8b\u3002\u8bbe\u4e3a&gt;0\u65f6\uff0c\u5e03\u5c40\u7ec4\u4ef6\u4f1a\u6309\u6bd4\u4f8b\u81ea\u52a8\u8c03\u6574\u7ec4\u4ef6\u5927\u5c0f\u3002\u53ea\u6709\u5bb9\u5668\u662fTLinearLayout\u65f6\u6709\u6548\u3002<\/p>\n<p>WidthSize<\/p>\n<p>\u7ec4\u4ef6\u5bbd\u5ea6\u8c03\u8282\u65b9\u5f0f\uff0cWrapContent \u9ed8\u8ba4\uff0c\u968f\u5185\u5bb9\u51b3\u5b9a\uff1b FillParent\uff0c\u586b\u5145\u5bb9\u5668\u3002\u4e00\u822c\u5728\u5bb9\u5668\u662fTLinearLayout\u65f6\u6709\u6548\u3002<\/p>\n<p><strong>\u3010\u65b9\u6cd5\u548c\u51fd\u6570\u3011<\/strong><\/p>\n<p>SetBackground\uff1a \u8bbe\u7f6e\u7ec4\u4ef6\u7684\u9ed8\u8ba4\u80cc\u666f\u3002\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u989c\u8272\u3001Drawable\u3001\u6e10\u53d8\u3001\u56fe\u50cf\u3001\u5237\u5b50\u3002<\/p>\n<p>IsPressed\uff1a \u662f\u5426\u6309\u4e0b\u3002<\/p>\n<p>IsHovered\uff1a \u662f\u5426\u60ac\u505c\u3002<\/p>\n<p>IsActivated\uff1a\u662f\u5426\u6fc0\u6d3b\u3002<\/p>\n<p><strong>\u4e8c\u3001 TLinearLayout<\/strong><\/p>\n<p>\u6545\u540d\u601d\u4e49\uff0cTLinearLayout\u5c31\u662f\u7ebf\u6027\u5e03\u5c40\u7ec4\u4ef6\u3002\u53ef\u4ee5\u5c06\u5185\u90e8\u7684\u5b50\u7ec4\u4ef6\u6309Orientation\u5c5e\u6027\u7684\u8bbe\u7f6e\uff0c\u6c34\u5e73\u6216\u5782\u76f4\u7684\u65b9\u5f0f\u81ea\u52a8\u6392\u5217\u3002<\/p>\n<p>TLinearLayout\u8fd8\u80fd\u6839\u636e\u5b50\u7ec4\u4ef6\u7684Weight\u5c5e\u6027\u6309\u6bd4\u4f8b\u8c03\u6574\u5927\u5c0f\uff0c\u6bd4\u5982\u5b50\u7ec4\u4ef6\u4e2d\u6709\u4e09\u4e2a\uff0cWeight\u5206\u522b\u4e3a1, 1, 2\uff0c\u90a3\u4e48\u8fd9\u4e09\u4e2a\u5b50\u7ec4\u4ef6\u5927\u5bbd\u5ea6\u6216\u9ad8\u5ea6\u5c06\u5206\u522b\u4e3a\u5bb9\u5668\u9ad8\u5ea6\u6216\u5bbd\u5ea6\u768425%\u300125%\u300150%\u3002\u5f53\u4f7f\u7528\u4e86Weight\u65f6\uff0cWidthSize\u6216HeightSize\u7684\u6548\u679c\u5c06\u88ab\u5ffd\u7565\u3002<\/p>\n<p>TLinearLayout\u5728\u81ea\u52a8\u6392\u5217\u5b50\u63a7\u4ef6\u65f6\uff0c\u8fd8\u4f1a\u6309\u7167Gravity\u91cd\u529b\u5c5e\u6027\u7684\u8bbe\u7f6e\uff0c\u5c06\u5b50\u7ec4\u4ef6\u5b9a\u4f4d\u5230\u4e0d\u540c\u7684\u4f4d\u7f6e\u3002<\/p>\n<p><strong>\u3010\u5c5e\u6027\u8bf4\u660e\u3011<\/strong><\/p>\n<p>\uff08\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5217\uff09\uff1a<\/p>\n<p>Orientation<\/p>\n<p>\u7ec4\u4ef6\u7684\u5e03\u5c40\u65b9\u5f0f\u3002Horizontal\uff0c\u6c34\u5e73\u5e03\u5c40\uff1b Vertical\uff0c\u5782\u76f4\u5e03\u5c40\u3002\u9ed8\u8ba4\u4e3aHorizontal\u3002<\/p>\n<p>\u5176\u5b83\u5c5e\u6027\u53c2\u8003TView\u3002<\/p>\n<p><strong>\u4e09\u3001TRelativeLayout<\/strong><\/p>\n<p>\u76f8\u5bf9\u5e03\u5c40\u7ec4\u4ef6\u3002\u5c06\u4efb\u4f55\u57fa\u4e8eTView\u6216\u5b9e\u73b0IView\u63a5\u53e3\u7684\u7ec4\u4ef6\u653e\u5165TRelativeLayout\u65f6\uff0c\u7ec4\u4ef6\u7684Layout\u5c5e\u6027\u5c31\u4f1a\u53d8\u6210\u53ef\u7528\u72b6\u6001\u3002\u4f60\u53ef\u4ee5\u901a\u8fc7\u8bbe\u7f6eLyaout\u7684\u5404\u4e2a\u5c5e\u6027\u503c\uff0c\u6765\u6307\u5b9a\u63a7\u4ef6\u7684\u5b9a\u4f4d\u65b9\u5f0f\u3002<\/p>\n<p>\u5728TRelativeLayout\u4e2d\uff0c\u5b50\u7ec4\u4ef6\u5728\u76f8\u5bf9\u5b9a\u4f4d\u65f6\uff0c\u53ea\u80fd\u5f15\u7528\u540c\u4e00\u4e2a\u5bb9\u5668\u4e2d\u7684\u5176\u5b83\u7ec4\u4ef6\u3002\u540c\u65f6\uff0c\u76f8\u4e92\u5f15\u7528\u65f6\u4e0d\u5141\u8bb8\u4ea7\u751f\u5faa\u73af\uff0c\u6700\u5927\u5f15\u7528\u5c42\u6570\u4e0d\u8d85\u8fc7256\u5c42\u3002<\/p>\n<p>\u5728TRelativeLayout\u4e2d\uff0c\u5b50\u7ec4\u4ef6\u7684Weight\u5c5e\u6027\u3001Gravity\u91cd\u529b\u5c5e\u6027\u65e0\u6548\u3002<\/p>\n<p><strong>\u56db\u3001TDrawable<\/strong><\/p>\n<p>TDrawable\u672c\u8eab\u662f\u4e00\u4e2a\u53ef\u7ed8\u5236\u7684\u5bf9\u8c61\u3002\u5728Draw\u65f6\uff0c\u4f1a\u6839\u636e\u6240\u6709\u8005\u89c6\u56fe\u7684ViewState\u89c6\u56fe\u72b6\u6001\u6765\u51b3\u5b9a\u663e\u793a\u7684\u6548\u679c\u3002<\/p>\n<p><strong>\u3010\u5c5e\u6027\u8bf4\u660e\u3011<\/strong><\/p>\n<p>XRadius\u3001YRadius<\/p>\n<p>\u5706\u89d2\u5927\u5c0f\u3002<\/p>\n<p>Padding\u3001Paddings<\/p>\n<p>\u7ed8\u56fe\u65f6\u7559\u767d\u5927\u5c0f\u3002<\/p>\n<p>ItemDefault<\/p>\n<p>\u9ed8\u8ba4\u72b6\u6001\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemPressed<\/p>\n<p>\u6309\u4e0b\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemFocused<\/p>\n<p>\u83b7\u53d6\u7126\u70b9\u540e\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemHovered<\/p>\n<p>\u60ac\u505c\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemSelected<\/p>\n<p>\u5df2\u7ecf\u88ab\u9009\u4e2d\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemChecked<\/p>\n<p>\u5df2\u7ecf\u88ab\u590d\u9009\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemEnabled<\/p>\n<p>\u65e0\u6548\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>ItemActivated<\/p>\n<p>\u5df2\u6fc0\u6d3b\u65f6\u7684\u663e\u793a\u8bbe\u7f6e\u3002<\/p>\n<p>\u4ee5\u4e0a\u5c5e\u6027\u4e2d\uff0cItemXXX\u5c5e\u6027\u90fd\u662f\u4e00\u4e2aTViewBrush\u5bf9\u8c61\u3002TViewBrush\u57fa\u4e8eTBrush\u3002\u53ef\u4ee5\u7ed9\u5b83\u6307\u5b9a\u4e00\u4e2a\u989c\u8272\u3001\u56fe\u50cf\u3001\u6e10\u53d8\u7b49\uff0c\u901a\u8fc7\u66f4\u6539Kind\u503c\u6765\u51b3\u5b9a\u5e94\u7528\u90a3\u4e00\u6837\u3002<\/p>\n<p><strong>\u3010\u65b9\u6cd5\u548c\u51fd\u6570\u3011<\/strong><\/p>\n<p>Draw\uff1a\u3000\u7ed8\u5236\u5230\u6307\u5b9aCanvas\u4e2d\u3002<\/p>\n<p>SetRadius\uff1a \u6307\u5b9a\u5706\u89d2\u5927\u5c0f\u3002<\/p>\n<p>SetDrawable\uff1a \u6307\u5b9a\u8981\u5e94\u7528\u7684Drawable\u8bbe\u7f6e\u3002<\/p>\n<p>SetBrush\uff1a \u7ed9\u6307\u5b9a\u72b6\u6001\u8bbe\u7f6e\u4e00\u4e2a\u5237\u5b50\u3002<\/p>\n<p>SetColor\uff1a \u7ed9\u6307\u5b9a\u72b6\u6001\u8bbe\u7f6e\u4e00\u4e2a\u989c\u8272\u3002<\/p>\n<p>SetGradient\uff1a\u7ed9\u6307\u5b9a\u72b6\u6001\u8bbe\u7f6e\u4e00\u4e2a\u6e10\u53d8\u6548\u679c\u3002<\/p>\n<p>SetBitmap\uff1a\u3000\u7ed9\u6307\u5b9a\u72b6\u6001\u8bbe\u7f6e\u4e00\u4e2a\u56fe\u50cf\u3002<\/p>\n<p><strong>\u4e94\u3001TViewLayout<\/strong><\/p>\n<p>\u76f8\u5bf9\u5e03\u5c40\u5c5e\u6027\u3002TRelativeLayout\u4f1a\u6839\u636e\u6b64\u8bbe\u7f6e\u6765\u8c03\u6574\u5b50\u7ec4\u4ef6\u7684\u4f4d\u7f6e\u548c\u5927\u5c0f\u3002<\/p>\n<p><strong>\u3010\u5c5e\u6027\u8bf4\u660e\u3011<\/strong><\/p>\n<p>ToLeftOf<\/p>\n<p>\u4f4d\u4e8e\u6307\u5b9a\u7ec4\u4ef6\u7684\u5de6\u8fb9\u3002\u540c\u65f6\u8bbe\u7f6eToRightOf\u65f6\u4f1a\u81ea\u52a8\u8c03\u6574\u5bbd\u5ea6\u3002<\/p>\n<p>ToRightOf<\/p>\n<p>\u4f4d\u4e8e\u6307\u5b9a\u7ec4\u4ef6\u7684\u53f3\u8fb9\u3002\u540c\u65f6\u8bbe\u7f6eToLeftOf\u65f6\u4f1a\u81ea\u52a8\u8c03\u6574\u5bbd\u5ea6\u3002<\/p>\n<p>Above<\/p>\n<p>\u4f4d\u4e8e\u6307\u5b9a\u7ec4\u4ef6\u7684\u4e0a\u8fb9\u3002\u540c\u65f6\u8bbe\u7f6eBelow\u65f6\u4f1a\u81ea\u52a8\u8c03\u6574\u9ad8\u5ea6\u3002<\/p>\n<p>Below<\/p>\n<p>\u4f4d\u4e8e\u6307\u5b9a\u7ec4\u4ef6\u7684\u4e0b\u8fb9\u3002\u540c\u65f6\u8bbe\u7f6eAbove\u65f6\u4f1a\u81ea\u52a8\u8c03\u6574\u9ad8\u5ea6\u3002<\/p>\n<p>AlignBaseline<\/p>\n<p>\u4e0e\u6307\u5b9a\u7ec4\u4ef6\u57fa\u7ebf\u5bf9\u9f50\u3002<\/p>\n<p>AlignLeft<\/p>\n<p>\u4e0e\u6307\u5b9a\u7ec4\u4ef6\u5de6\u5bf9\u9f50\u3002<\/p>\n<p>AlignTop<\/p>\n<p>\u4e0e\u6307\u5b9a\u7ec4\u4ef6\u9876\u90e8\u5bf9\u9f50\u3002<\/p>\n<p>AlignRight<\/p>\n<p>\u4e0e\u6307\u5b9a\u7ec4\u4ef6\u53f3\u5bf9\u9f50\u3002<\/p>\n<p>AlignBottom<\/p>\n<p>\u4e0e\u6307\u5b9a\u7ec4\u4ef6\u5e95\u90e8\u5bf9\u9f50\u3002<\/p>\n<p>WidthSize\uff0c HeightSize<\/p>\n<p>\u7ec4\u4ef6\u5927\u5c0f\u8c03\u6574\u65b9\u5f0f\u3002WrapContent\uff0c\u968f\u5185\u5bb9\u3002FillParent\uff0c\u586b\u5145\u5bb9\u5668\u3002<\/p>\n<p>AlignParentLeft<\/p>\n<p>\u4f4d\u4e8e\u5bb9\u5668\u5de6\u8fb9\u3002<\/p>\n<p>AlignParentTop<\/p>\n<p>\u4f4d\u4e8e\u5bb9\u5668\u9876\u90e8\u3002<\/p>\n<p>AlignParentRight<\/p>\n<p>\u4f4d\u4e8e\u5bb9\u5668\u53f3\u8fb9\u3002<\/p>\n<p>AlignParentBottom<\/p>\n<p>\u4f4d\u4e8e\u5bb9\u5668\u5e95\u90e8\u3002<\/p>\n<p>CenterInParent<\/p>\n<p>\u4f4d\u4e8e\u5bb9\u5668\u4e2d\u95f4\u3002<\/p>\n<p>CenterHorizontal<\/p>\n<p>\u5728\u5bb9\u5668\u4e2d\u6c34\u5e73\u5c45\u4e2d\u3002<\/p>\n<p>CenterVertical<\/p>\n<p>\u5728\u5bb9\u5668\u4e2d\u5782\u76f4\u5c45\u4e2d\u3002<\/p>\n<p><strong>\u516d\u3001\u7ed3\u675f\u8bed<\/strong><\/p>\n<p>\u4e0a\u9762\u5df2\u7ecf\u5c06\u5e38\u7528\u7c7b\u7684\u4e00\u4e9b\u5c5e\u6027\u548c\u65b9\u6cd5\u3001\u51fd\u6570\u505a\u4e86\u8bf4\u660e\uff0c\u672c\u6587\u4e5f\u5c31\u5feb\u7ed3\u675f\u4e86\u3002\u5927\u5bb6\u5728\u4f7f\u7528\u65f6\uff0c\u53ef\u4ee5\u7075\u6d3b\u7684\u7528TLinearLayout\u3001TRelativeLayout\u505a\u5d4c\u5957\uff0c\u8bbe\u8ba1\u51fa\u60f3\u8981\u7684\u6548\u679c\u3002\u8fd8\u53ef\u4ee5\u901a\u8fc7\u6307\u5b9aBackground\u7684\u5706\u89d2\u5927\u5c0f\uff0c\u6574\u51fa\u5e26\u5706\u89d2\u7684\u89c6\u56fe\uff0c\u8fd8\u8981\u5b66\u4e60\u901a\u8fc7\u8bbe\u7f6ePadding\u3001Margins\u5c5e\u6027\u6765\u5b9a\u4f4d\u7ec4\u4ef6\u3002\u6700\u540e\u5e0c\u671b\u5927\u5bb6\u90fd\u80fd\u8bbe\u8ba1\u51fa\u60f3\u8981\u7684\u754c\u9762\u6548\u679c\uff0c\u4f7f\u7528\u4e86FMXUI\u7684\u540c\u5b66\uff0c\u53d1\u73b0Bug\u65f6\u5e0c\u671b\u80fd\u901a\u8fc7QQ\u6216\u7559\u8a00\u7684\u65b9\u5f0f\u544a\u8bc9\u6211\u3002<\/p>\n<p>SVN:\u00a0 <a href=\"https:\/\/github.com\/yangyxd\/FMXUI\" target=\"_blank\">https:\/\/github.com\/yangyxd\/FMXUI<\/a><\/p>\n<p>\u672c\u6587\u9996\u53d1\uff1a <a href=\"http:\/\/www.cnblogs.com\/yangyxd\/\" target=\"_blank\">http:\/\/www.cnblogs.com\/yangyxd\/<\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u7ec8\u4e8e\u71ac\u8fc7\u4e86\u4eca\u5e74\u7684\u6700\u540e\u4e00\u5929\u73ed\uff0c\u54e5\u4eec\u6000\u7740\u5174\u594b [&hellip;]<\/p>\n","protected":false},"author":3,"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":[145,8],"tags":[551],"class_list":["post-3525","post","type-post","status-publish","format-standard","hentry","category-android","category-delphi","tag-fmxui"],"views":7988,"_links":{"self":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3525","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\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3525"}],"version-history":[{"count":2,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3525\/revisions"}],"predecessor-version":[{"id":3528,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=\/wp\/v2\/posts\/3525\/revisions\/3528"}],"wp:attachment":[{"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3525"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3525"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.qdac.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3525"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}