{"id":12693,"date":"2023-01-06T10:00:00","date_gmt":"2023-01-06T01:00:00","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=12693"},"modified":"2023-01-05T19:15:47","modified_gmt":"2023-01-05T10:15:47","slug":"ios-13%e3%82%b9%e3%82%bf%e3%82%a4%e3%83%ab%e3%81%aesegmentcontrol","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/12693","title":{"rendered":"iOS 13\u30b9\u30bf\u30a4\u30eb\u306eSegmentControl"},"content":{"rendered":"\n<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306fFlutter \u306eSegmentControl\u4f5c\u6210\u3059\u308b\u306e\u65b9\u6cd5\u3092 \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u3067\u5171\u6709\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<p>\u4eca\u306e\u8a18\u4e8b\u3067\u306f\u3001CupertinoSlidingSegmentedControl\u3092enum\u578b\u306b\u3057\u305f\u3082\u306e\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<p>navigationBar\u304b\u3089\u5909\u66f4\u3057\u305f\u6642onValueChanged\u306f\u3001\u73fe\u5728\u306eStatefulWidget\u306e\u72b6\u614b\u3092enum\u306e\u5024\u306b\u3088\u3063\u3066\u5909\u66f4\u3059\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<br>\u307e\u305a\u306fSky.midnight\u3092\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8272\u306b\u306a\u308b\u3088\u3046\u306b\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Sky _selectedSegment = Sky.midnight; <\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>enum Sky { midnight, viridian, cerulean }\n\nMap&lt;Sky, Color&gt; skyColors = &lt;Sky, Color&gt;{\n  Sky.midnight: const Color(0xff8000ff),\n  Sky.viridian: const Color(0xff40826d),\n  Sky.cerulean: const Color(0xff007ba7),\n};\n\nreturn CupertinoPageScaffold(\n      backgroundColor: skyColors&#091;_selectedSegment],\n      navigationBar: CupertinoNavigationBar(\n        onValueChanged: (Sky? value) {\n            if (value != null) {\n              setState(() {\n                _selectedSegment = value;\n              });\n            }\n          },\n\/\/...\n ),\n);<\/code><\/pre>\n\n\n\n<p>navigationBar\u306ethumbColor\u3084groupValue\u306f\u3001\u73fe\u5728\u9078\u629e\u3055\u308c\u3066\u3044\u308bSegmentControl\u3092\u8868\u793a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>navigationBar: CupertinoNavigationBar(\n        middle: CupertinoSlidingSegmentedControl&lt;Sky&gt;(\n          backgroundColor: CupertinoColors.activeOrange,\n          thumbColor: skyColors&#091;_selectedSegment]!,\n           groupValue: _selectedSegment,\n        ),\n      ),<\/code><\/pre>\n\n\n\n<p>navigationBar\u3067\u8868\u793a\u3057\u305f\u3044Widget\u30ea\u30b9\u30c8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>children: const &lt;Sky, Widget&gt;{\n            Sky.midnight: Padding(\n              padding: EdgeInsets.symmetric(horizontal: 20),\n              child: Text(\n                'Midnight',\n                style: TextStyle(color: CupertinoColors.white),\n              ),\n            ),\n            Sky.viridian: Padding(\n              padding: EdgeInsets.symmetric(horizontal: 20),\n              child: Text(\n                'Viridian',\n                style: TextStyle(color: CupertinoColors.white),\n              ),\n            ),\n            Sky.cerulean: Padding(\n              padding: EdgeInsets.symmetric(horizontal: 20),\n              child: Text(\n                'Cerulean',\n                style: TextStyle(color: CupertinoColors.white),\n              ),\n            ),\n          },<\/code><\/pre>\n\n\n\n<p>Segment Control\u306b\u3088\u3063\u3066\u8868\u793a\u3057\u305f\u3044\u30c6\u30b9\u30c8<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Center(\n        child: Text(\n          'Selected Segment: ${_selectedSegment.name}',\n          style: const TextStyle(color: CupertinoColors.white),\n        ),\n      ),<\/code><\/pre>\n\n\n\n<p>\u7d50\u679c\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" src=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2023\/01\/Screen-Shot-2023-01-05-at-17.43.09.png\" alt=\"\" class=\"wp-image-12694\" width=\"409\" height=\"607\" \/><\/figure>\n\n\n\n<p>\u53c2\u8003\u8a18\u4e8b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#047;&#047;api.flutter.dev\/flutter\/cupertino\/CupertinoSlidingSegmentedControl-class.html<\/code><\/pre>\n\n\n\n<p>\u91d1\u66dc\u62c5\u5f53 \u2013 Ami<\/p>\n<div class='wp_social_bookmarking_light'>\n            <div class=\"wsbl_google_plus_one\"><g:plusone size=\"medium\" annotation=\"none\" href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12693\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/12693\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"iOS 13\u30b9\u30bf\u30a4\u30eb\u306eSegmentControl\" data-hatena-bookmark-layout=\"standard\" title=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\"> <img src=\"\/\/b.hatena.ne.jp\/images\/entry-button\/button-only@2x.png\" alt=\"\u3053\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u3092\u306f\u3066\u306a\u30d6\u30c3\u30af\u30de\u30fc\u30af\u306b\u8ffd\u52a0\" width=\"20\" height=\"20\" style=\"border: none;\" \/><\/a><script type=\"text\/javascript\" src=\"\/\/b.hatena.ne.jp\/js\/bookmark_button.js\" charset=\"utf-8\" async=\"async\"><\/script><\/div>\n            <div class=\"wsbl_twitter\"><a href=\"https:\/\/twitter.com\/share\" class=\"twitter-share-button\" data-url=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12693\" data-text=\"iOS 13\u30b9\u30bf\u30a4\u30eb\u306eSegmentControl\" data-via=\"GIGASJAPAN_APPS\" data-lang=\"ja\">Tweet<\/a><\/div>\n            <div class=\"wsbl_facebook_like\"><div id=\"fb-root\"><\/div><fb:like href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12693\" layout=\"button_count\" action=\"like\" width=\"100\" share=\"false\" show_faces=\"false\" ><\/fb:like><\/div>\n            <div class=\"wsbl_facebook_send\"><div id=\"fb-root\"><\/div><fb:send href=\"https:\/\/www.gigas-jp.com\/appnews\/archives\/12693\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u4eca\u56de\u306e\u8a18\u4e8b\u3067\u306fFlutter \u306eSegmentControl\u4f5c\u6210\u3059\u308b\u306e\u65b9\u6cd5\u3092 \u30b9\u30c6\u30c3\u30d7\u30d0\u30a4\u30b9\u30c6\u30c3\u30d7\u3067\u5171\u6709\u3057\u307e\u3059\u3002 \u4eca\u306e\u8a18\u4e8b\u3067\u306f\u3001CupertinoSlidingSegmentedControl\u3092enum\u578b\u306b\u3057\u305f\u3082\u306e\u3092\u8868\u793a [&hellip;]<\/p>\n","protected":false},"author":19,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12693"}],"collection":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/users\/19"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=12693"}],"version-history":[{"count":1,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12693\/revisions"}],"predecessor-version":[{"id":12695,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/12693\/revisions\/12695"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=12693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=12693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=12693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}