{"id":5593,"date":"2017-04-04T10:00:34","date_gmt":"2017-04-04T01:00:34","guid":{"rendered":"https:\/\/www.gigas-jp.com\/appnews\/?p=5593"},"modified":"2017-04-04T15:11:04","modified_gmt":"2017-04-04T06:11:04","slug":"%e6%96%b0%e4%ba%ba%e6%88%90%e9%95%b7%e8%a8%98%e9%8c%b221th","status":"publish","type":"post","link":"https:\/\/www.gigas-jp.com\/appnews\/archives\/5593","title":{"rendered":"\u65b0\u4eba\u6210\u9577\u8a18\u933221th"},"content":{"rendered":"<p>\u6700\u8fd1\u306f\u4fbf\u5229\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u306a\u3044\u304b\u3001\u6642\u9593\u304c\u3042\u308b\u6642\u306b\u63a2\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001<br \/>\nTabHost\u3068\u3044\u3046\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u4fbf\u5229\u304b\u3068\u601d\u3044\u307e\u3057\u305f\u306e\u3067\u7d39\u4ecb\u3057\u307e\u3059<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-5596\" src=\"\/appnews\/wp-content\/uploads\/sites\/4\/2017\/04\/tabhost-169x300.png\" alt=\"tabhost\" width=\"169\" height=\"300\" border=\"1\" srcset=\"https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/04\/tabhost-169x300.png 169w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/04\/tabhost-576x1024.png 576w, https:\/\/www.gigas-jp.com\/appnews\/wp-content\/uploads\/sites\/4\/2017\/04\/tabhost.png 1080w\" sizes=\"(max-width: 169px) 100vw, 169px\" \/><\/p>\n<p><!--more--><\/p>\n<h3>TabHost\u3068\u306f<\/h3>\n<p>\u30bf\u30d6\u4ed8\u304d\u306e\u30a6\u30a3\u30f3\u30c9\u30a6\u30d3\u30e5\u30fc\u306e\u30b3\u30f3\u30c6\u30ca\u3092\u63d0\u4f9b\u3057\u3066\u304f\u308c\u307e\u3059<br \/>\n\u30b7\u30f3\u30d7\u30eb\u3067\u3001\u5b9f\u88c5\u3082\u6bd4\u8f03\u7684\u306b\u7c21\u5358\u3067\u3059<\/p>\n<p>\u5b9f\u88c5\u65b9\u6cd5\u3067\u3059\u304c\u3001TabHost\u306f<strong><span style=\"color: #0000ff;\">TabWidget\u3068FrameLayout\u306e2\u3064\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059<\/span><\/strong>\u306e\u3067\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3057\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px;\"><code>&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;TabHost\r\n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n    android:id=\"@+id\/tabhost\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"&gt;\r\n\r\n    &lt;LinearLayout\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"\r\n        android:orientation=\"vertical\"&gt;\r\n        &lt;TabWidget\r\n            android:id=\"@android:id\/tabs\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"wrap_content\"\r\n            \/&gt;\r\n\r\n        &lt;FrameLayout\r\n            android:id=\"@android:id\/tabcontent\"\r\n            android:layout_width=\"match_parent\"\r\n            android:layout_height=\"match_parent\"\r\n            &gt;\r\n        &lt;\/FrameLayout&gt;\r\n    &lt;\/LinearLayout&gt;\r\n&lt;\/TabHost&gt;\r\n<\/code><\/pre>\n<p>FrameLayou\u306e\u90e8\u5206\u304c\u30b3\u30f3\u30c6\u30f3\u30c4\u3092\u8868\u793a\u3059\u308b\u7b87\u6240\u3068\u306a\u308a\u307e\u3059<\/p>\n<p>\u56fa\u5b9a\u306e\u30ec\u30a4\u30a2\u30a6\u30c8\u3092\u8868\u793a\u3055\u305b\u308b\u306e\u306a\u3089\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306bFrameLayout\u306b\u8868\u793a\u3057\u305f\u3044\u30ec\u30a4\u30a2\u30a6\u30c8\u5206\u306e\u8a18\u8ff0\u3059\u308c\u3070\u5927\u4e08\u592b\u3067\u3059<\/p>\n<pre style=\"border: dashed #000000 2px;\"><code>&lt;FrameLayout\r\n    android:id=\"@android:id\/tabcontent\"\r\n    android:layout_width=\"match_parent\"\r\n    android:layout_height=\"match_parent\"\r\n    &gt;\r\n    &lt;LinearLayout\r\n        android:id=\"@+id\/frame1\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"&gt;\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"tab1\"\r\n            \/&gt;\r\n    &lt;\/LinearLayout&gt;\r\n    &lt;LinearLayout\r\n        android:id=\"@+id\/frame2\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"match_parent\"&gt;\r\n        &lt;TextView\r\n            android:layout_width=\"wrap_content\"\r\n            android:layout_height=\"wrap_content\"\r\n            android:text=\"tab2\"\r\n            \/&gt;\r\n    &lt;\/LinearLayout&gt;\r\n&lt;\/FrameLayout&gt;\r\n<\/code><\/pre>\n<p>1\u3064\u76ee\u306e\u30bf\u30d6\u306fframe1\u30012\u3064\u76ee\u306e\u30bf\u30d6\u306fframe2\u3068\u306a\u308a\u307e\u3059<\/p>\n<p>\u30d7\u30ed\u30b0\u30e9\u30e0\u306b\u95a2\u3057\u3066\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059<\/p>\n<pre style=\"border: dashed #000000 2px;\"><code>\t@Override\r\n\tprotected void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\t\tsetContentView(R.layout.activity_main);\r\n\t\tTabHost host = (TabHost) findViewById(R.id.tabhost);\r\n\t\thost.setup();\r\n\r\n\t\tTabHost.TabSpec spec1 = host.newTabSpec(\"tab1\");\r\n\t\tspec1.setIndicator(\"tab1\");\r\n\t\tspec1.setContent(R.id.frame1);\r\n\t\thost.addTab(spec1);\r\n\r\n\t\tTabHost.TabSpec spec2 = host.newTabSpec(\"tab2\");\r\n\t\tspec2.setIndicator(\"tab2\");\r\n\t\tspec2.setContent(R.id.frame2);\r\n\t\thost.addTab(spec2);\r\n\r\n\t\thost.setOnTabChangedListener(this);\r\n\t}\r\n\r\n\t@Override\r\n\tpublic void onTabChanged(String tabId) {\r\n\t\tLog.d(\"debug\", tabId);\r\n\t}\r\n<\/code><\/pre>\n<p>findViewById\u3067TabHost\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306b\u306f\u3001<strong><span style=\"color: #0000ff;\">\u30bf\u30d6\u3092\u8ffd\u52a0\u3059\u308b\u524d\u306bsetup()<\/span><\/strong>\u3092\u5b9f\u884c\u3057\u306a\u3044\u3068\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u307e\u3059<br \/>\nfindViewById\u4ee5\u5916\u3067\u306f\u3001extends\u3067TabActvity\u306b\u62e1\u5f35\u3057\u3066getTabHost()\u3067\u53d6\u5f97\u3067\u304d\u307e\u3059<br \/>\n\u305f\u3060<strong><span style=\"color: #0000ff;\">TabActivity\u306f\u3001deprecated<\/span><\/strong>\u3068\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u4f7f\u3046\u3079\u304d\u3067\u306f\u306a\u3044\u3068\u601d\u3044\u307e\u3059<\/p>\n<p>TabSpec\u3092\u53d6\u5f97\u3059\u308b\u6642\u306b\u4f7f\u7528\u3059\u308bnewTabSpec\u306e\u5f15\u6570\u306f\u3001\u305d\u306e\u30bf\u30d6\u306e\u8a8d\u8b58\u306b\u4f7f\u3044\u307e\u3059<br \/>\nsetIndicator\u3067\u306f\u3001\u30bf\u30d6\u306b\u8868\u793a\u3055\u308c\u308b\u6587\u5b57\u5217\u3092\u5f15\u6570\u3068\u3057\u3066\u3044\u307e\u3059<br \/>\nsetContent\u3067\u306f\u3001FrameLayout\u5185\u306b\u8a18\u8ff0\u3057\u305f\u30ec\u30a4\u30a2\u30a6\u30c8\u306eID\u3092\u6307\u5b9a\u3057\u307e\u3059<\/p>\n<p>onTabChanged\u306f\u3001\u30bf\u30d6\u304c\u5207\u308a\u66ff\u308f\u308b\u3068\u304d\u306b\u547c\u3070\u308c\u308b\u30b3\u30fc\u30eb\u30d0\u30c3\u30af\u3067\u3059<br \/>\nTabHost.OnTabChangeListener\u3092\u5b9f\u88c5\u3059\u308b\u3053\u3068\u3067Override\u3067\u304d\u307e\u3059<br \/>\n\u30ed\u30b0\u4e0a\u3067\u306f\u3001newTabSpec\u3067\u8a2d\u5b9a\u3057\u305f\u5024\u304c\u3001\u53d6\u5f97\u3067\u304d\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059<\/p>\n<h3>\u7d42\u308f\u308a\u306b<\/h3>\n<p>\u4eca\u56de\u306e\u3088\u3046\u306a\u4fbf\u5229\u3067\u77e5\u3089\u306a\u3044\u30ec\u30a4\u30a2\u30a6\u30c8\u306f\u307e\u3060\u3042\u308b\u3068\u601d\u3044\u307e\u3059\u306e\u3067\u3001\u4eca\u5f8c\u3082\u63a2\u3057\u3066\u958b\u767a\u306b\u53cd\u6620\u3057\u3066\u3044\u304d\u305f\u3044\u3067\u3059<\/p>\n<p>\u706b\u66dc\u65e5\u62c5\u5f53\uff1apoppy<\/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\/5593\" ><\/g:plusone><\/div>\n            <div class=\"wsbl_hatena_button\"><a href=\"\/\/b.hatena.ne.jp\/entry\/https:\/\/www.gigas-jp.com\/appnews\/archives\/5593\" class=\"hatena-bookmark-button\" data-hatena-bookmark-title=\"\u65b0\u4eba\u6210\u9577\u8a18\u933221th\" 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\/5593\" data-text=\"\u65b0\u4eba\u6210\u9577\u8a18\u933221th\" 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\/5593\" 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\/5593\" colorscheme=\"light\" ><\/fb:send><\/div>\n    <\/div>\n<br class='wp_social_bookmarking_light_clear' \/>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1\u306f\u4fbf\u5229\u306a\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u306a\u3044\u304b\u3001\u6642\u9593\u304c\u3042\u308b\u6642\u306b\u63a2\u3057\u3066\u3044\u308b\u306e\u3067\u3059\u304c\u3001 TabHost\u3068\u3044\u3046\u30ec\u30a4\u30a2\u30a6\u30c8\u304c\u4fbf\u5229\u304b\u3068\u601d\u3044\u307e\u3057\u305f\u306e\u3067\u7d39\u4ecb\u3057\u307e\u3059<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[100,12],"tags":[56,79,112],"acf":[],"_links":{"self":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5593"}],"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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/comments?post=5593"}],"version-history":[{"count":8,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5593\/revisions"}],"predecessor-version":[{"id":5604,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/posts\/5593\/revisions\/5604"}],"wp:attachment":[{"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/media?parent=5593"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/categories?post=5593"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gigas-jp.com\/appnews\/wp-json\/wp\/v2\/tags?post=5593"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}