{"id":660,"date":"2024-10-02T09:25:10","date_gmt":"2024-10-02T00:25:10","guid":{"rendered":"https:\/\/txn.myds.me\/blog\/?p=660"},"modified":"2024-10-02T09:25:10","modified_gmt":"2024-10-02T00:25:10","slug":"kivy-anchorlayout-%e3%81%8c%e5%8a%b9%e3%81%8b%e3%81%aa%e3%81%84%e6%99%82%e3%81%af%e3%82%b5%e3%82%a4%e3%82%ba%e3%82%92%e6%8c%87%e5%ae%9a%e3%81%99%e3%82%8b%e3%81%a8%e8%89%af%e3%81%84","status":"publish","type":"post","link":"https:\/\/blog.txn.red\/?p=660","title":{"rendered":"Kivy AnchorLayout \u304c\u52b9\u304b\u306a\u3044\u6642\u306f\u30b5\u30a4\u30ba\u3092\u6307\u5b9a\u3059\u308b\u3068\u826f\u3044"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u4eca\u56de\u3082 Kivy \u30cd\u30bf\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067(\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306f\u9664\u304d) \u3067\u53f3\u5bc4\u305b\u304c\u52b9\u304b\u305a\u3061\u3087\u3044\u30cf\u30de\u308a\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Stack Overflow \u306b\u30b9\u30ec\u304c\u3042\u308a\u3001CSS \u306e\u30d6\u30ed\u30c3\u30af\u30a8\u30ec\u30e1\u30f3\u30c8\/\u30a4\u30f3\u30e9\u30a4\u30f3\u30a8\u30ec\u30e1\u30f3\u30c8 \u306e\u3088\u3046\u306a\u611f\u3058\u3067MDLabel \u306e\u5e45\u304c max \u306b\u8a2d\u5b9a\u3055\u308c\u3066\u3057\u307e\u3046\u3088\u3046\u3067\u3059\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3092\u89e3\u9664\u3059\u308b\u3068\u7121\u4e8b\u306b\u53f3\u5bc4\u305b\u304c\u6a5f\u80fd\u3057\u307e\u3057\u305f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Label \u3092 MDLabel \u306b\u3059\u308b\u3068\u5225\u306e\u30b9\u30bf\u30a4\u30eb\u304c\u6709\u52b9\u306b\u306a\u308b\u3088\u3046\u3067\u6587\u5b57\u304c\u898b\u5207\u308c\u3066\u3057\u307e\u3044\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306f size \u3092 tex\uff54ure_size \u304b\u3089\u5909\u66f4\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3088\u3046\u3067\u3059\u3002\u3053\u3053\u306f\u8ffd\u6c42\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\" data-line=\"17-19\"><code>from kivy.lang import Builder\nfrom kivymd.app import MDApp\n\nKV = &#39;&#39;&#39;\nMDScreen:\n    MDBoxLayout:\n        orientation: &#39;vertical&#39;\n        \n        AnchorLayout:\n            # size_hint_x: 1\n            anchor_x: &#39;right&#39;\n            anchor_y: &#39;center&#39;\n    \n            Label:\n                text: &#39;menu-&#39;\n\n                # \u3053\u306e2\u884c\u3092\u8ffd\u52a0\u3059\u308c\u3070 OK\n                # size_hint: (None, None)\n                # size: self.texture_size\n                max_lines: 1                    \n                padding: (dp(16), dp(0))\n&#39;&#39;&#39;\n\nclass MainApp(MDApp):\n    def build(self):\n        self.theme_cls.theme_style = &#39;Dark&#39;  # or &#39;Light&#39;\n        return Builder.load_string(KV)\n    \n\nif __name__ == &#39;__main__&#39;:\n    MainApp().run()\n<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"%25e5%258f%2582%25e8%2580%2583\">\u53c2\u8003<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/stackoverflow.com\/questions\/52790471\/kivy-anchorlayout-kv-file#:~:text=The%20problem%20is%20that%20the%20default%20size%20for\">python &#8211; Kivy AnchorLayout .Kv file &#8211; Stack Overflow<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u3082 Kivy \u30cd\u30bf\u3067\u3059\u3002 \u4e0b\u8a18\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3067(\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u306f\u9664\u304d) \u3067\u53f3\u5bc4\u305b\u304c\u52b9\u304b\u305a\u3061\u3087\u3044\u30cf\u30de\u308a\u307e\u3057\u305f\u3002 Stack Overflow \u306b\u30b9\u30ec\u304c\u3042\u308a\u3001CSS \u306e\u30d6\u30ed\u30c3\u30af\u30a8\u30ec\u30e1\u30f3\u30c8\/\u30a4\u30f3\u30e9\u30a4\u30f3\u30a8\u30ec\u30e1\u30f3\u30c8 \u306e\u3088\u3046\u306a\u611f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":0,"footnotes":""},"categories":[9],"tags":[18,14],"class_list":["post-660","post","type-post","status-publish","format-standard","hentry","category-dev","tag-kivy","tag-python"],"_links":{"self":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/660","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=660"}],"version-history":[{"count":0,"href":"https:\/\/blog.txn.red\/index.php?rest_route=\/wp\/v2\/posts\/660\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=660"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=660"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.txn.red\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=660"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}