{"id":1452,"date":"2020-12-02T19:03:47","date_gmt":"2020-12-02T10:03:47","guid":{"rendered":"https:\/\/bunktiruu.com\/?p=1452"},"modified":"2022-06-22T13:56:37","modified_gmt":"2022-06-22T04:56:37","slug":"%e3%80%90%e7%b6%99%e7%b6%9a%e6%9b%b4%e6%96%b0%e3%80%91%e3%83%ac%e3%82%a4%e3%82%a2%e3%82%a6%e3%83%88%e3%83%91%e3%83%bc%e3%83%84%e3%81%ae%e3%83%a1%e3%83%a2%ef%bc%88java%e7%89%88%ef%bc%89","status":"publish","type":"post","link":"https:\/\/bunktiruu.com\/?p=1452","title":{"rendered":"\u3010Android\u30a2\u30d7\u30ea\u958b\u767a\u3011\u7d99\u7d9a\u66f4\u65b0\uff1a\u30ec\u30a4\u30a2\u30a6\u30c8\u30d1\u30fc\u30c4\u306e\u30e1\u30e2\uff08Java\u7248\uff09"},"content":{"rendered":"\n<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u30af\u30ea\u30a8\u30a4\u30bf\u30fc\u306e\u3068\u3082\u3059\u3051\u3067\u3059\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u8a18\u4e8b\u306f\u3001\u6280\u8853\u30e1\u30e2\u3092\u66f8\u304d\u7559\u3081\u3066\u304a\u304f\u30da\u30fc\u30b8\u3067\u3059\u3002\u5c06\u6765\u6574\u7406\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u73fe\u6642\u70b9\u3067\u306f\u3064\u3089\u3064\u3089\u3068\u66f8\u304d\u9023\u306d\u308b\u3060\u3051\u3067\u3059\u3002Kotlin\u3092\u4f7f\u3048\u306a\u3044\u306e\u3067\u3001Java\u30b3\u30fc\u30c9\u3067\u3059\u3002\u76ee\u6b21\u304b\u3089\u307b\u3057\u3044\u60c5\u5831\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n\n\n\n<p>\u307e\u305f\u3001\u3067\u304d\u308b\u3060\u3051Code\u3067\u66f8\u304d\u305f\u3044\u4eba\u306a\u306e\u3067\u3001XML\u60c5\u5831\u306f\u3042\u308a\u307e\u305b\u3093\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EditText<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Activity\u304c\u547c\u3070\u308c\u305f\u3068\u304d\u306b\u81ea\u52d5\u3067\u30d5\u30a9\u30fc\u30ab\u30b9<\/h3>\n\n\n\n<p>\u6587\u5b57\u5165\u529b\u3059\u308b\u3068\u304d\u306b\u3001\u3044\u3061\u3044\u3061\u5165\u529b\u30a8\u30ea\u30a2\u3092\u30bf\u30c3\u30d7\u3059\u308b\u624b\u9593\u3092\u7701\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">EditText editText = new EditText(this);\neditText.requestFocus();  \/\/ \u3053\u308c<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">TextView<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\u30b5\u30a4\u30ba\u6307\u5b9a<\/h3>\n\n\n\n<p>\u30b5\u30a4\u30ba\u6307\u5b9a\u6642\u306f\u5358\u4f4d\u3092\u610f\u8b58\u3057\u305f\u65b9\u304c\u3044\u3044\u3068\u601d\u3046\u306e\u3067\u3059\u304c\u3001\u6587\u6cd5\u3092\u5fd8\u308c\u305f\u306e\u3067\u8abf\u3079\u305f\u7d50\u679c\u3092\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">TextView view = new TextView(this);\nview.setTextSize(<span class=\"ystdb-inline--3\">TypedValue.COMPLEX_UNIT_DIP<\/span>, int size);<\/code><\/pre>\n\n\n\n<p>&#8220;TypedValue.&#8221; \u307e\u3067\u5165\u529b\u3059\u308c\u3070\u3001\u4f55\u304c\u9078\u629e\u3067\u304d\u308b\u304b\u51fa\u3066\u304d\u307e\u3059\u3002\u7b46\u8005\u306f\u3001\u753b\u9762\u5bc6\u5ea6\u3068\u304b\u3092\u3042\u307e\u308a\u6c17\u306b\u3057\u306a\u304f\u306a\u3044\u306e\u3067\u57fa\u672c\u306fDIP\u3092\u4f7f\u3046\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u30d5\u30a9\u30f3\u30c8\u5909\u66f4<\/h3>\n\n\n\n<p>TextView\u306e\u968e\u5c64\u306b\u7f6e\u304d\u307e\u3057\u305f\u304c\u3001\u6587\u5b57\u8868\u793a\u7cfb\u3067\u306f\u540c\u69d8\u306b\u4f7f\u3048\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n\n\n\n<p>main\/assets\/fonts\u306b\u30d5\u30a9\u30f3\u30c8\u30d5\u30a1\u30a4\u30eb\uff08.ttf\uff09\u3092\u7f6e\u304f\u3068\u3001\u30a2\u30d7\u30ea\u306b\u8aad\u307e\u305b\u3066\u30d5\u30a9\u30f3\u30c8\u3092\u5909\u3048\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002assets\u3084fonts\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u3001\u306f\u3058\u3081\u306f\u306a\u3044\u306e\u3067\u81ea\u5206\u3067\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">TextView view = new TextView(this);\nTypeface typeface = Typeface.<em>createFromAsset<\/em>(getAssets(), \"fonts\/xxx.ttf\");\nview.setTypeface(typeface);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u753b\u9762\u306b\u53ce\u307e\u3089\u306a\u3044\u3068\u304d\u306e\u81ea\u52d5\u30b9\u30af\u30ed\u30fc\u30eb\uff08marquee\uff09<\/h3>\n\n\n\n<p>ScrollView\u7cfb\u306e\u8a71\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<span class=\"ystdb-inline--1\">\u30b3\u30e1\u30f3\u30c8\u30a2\u30a6\u30c8\u3057\u3066\u3044\u308b\u884c\u306f\u5931\u6557\u4f8b<\/span>\u3067\u3059\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u8868\u793a\u884c\u3092\uff11\u884c\u306b\u5236\u9650\u3059\u308b\u306e\u306b\u3001setMaxLines(1)\u3067\u306f\u610f\u5473\u304c\u306a\u304b\u3063\u305f\u3053\u3068<\/li><li>\u9078\u629e\u3057\u305f\u72b6\u614b\u3067\u306a\u3044\u3068\u30b9\u30af\u30ed\u30fc\u30eb\u3057\u306a\u3044\u3068\u306e\u3053\u3068\u3067\u3001setFocusable(true)\u3092\u4f7f\u3063\u305f\u304c\u9055\u3063\u305f<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"java\" class=\"language-java\">textView.setEllipsize(TextUtils.TruncateAt.MARQUEE);\n\/\/textView.setMaxLines(1);\ntextView.setSingleLine();\n\/\/textView.setFocusable(true);\ntextView.setSelected(true);<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u30bb\u30f3\u30bf\u30ea\u30f3\u30b0\u306a\u3069<\/h3>\n\n\n\n<p>TextView\u306b\u9650\u308a\u307e\u305b\u3093\u304c\u3001setGravity\u304c\u4f7f\u3048\u308bView\u306b\u4f7f\u3048\u308b\u624b\u6cd5\u3067\u3059\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">TextView view =\u3000new TextView(this);\nview.setGravity(Gravity.<em>CENTER<\/em>);<\/code><\/pre>\n\n\n\n<p>\u8a2d\u5b9a\u3067\u304d\u308bGravity\u306f\u3001\u300cGravity.\u300d\u307e\u3067\u5165\u529b\u3059\u308b\u3068\u88dc\u5b8c\u30ea\u30b9\u30c8\u304c\u51fa\u3066\u304d\u307e\u3059\u306e\u3067\u3001\u305d\u3053\u304b\u3089\u9078\u3093\u3067\u304f\u3060\u3055\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u30b3\u30f3\u30c6\u30f3\u30c4\u30af\u30ea\u30a8\u30a4\u30bf\u30fc\u306e\u3068\u3082\u3059\u3051\u3067\u3059\u3002 \u3053\u306e\u8a18\u4e8b\u306f\u3001\u6280\u8853\u30e1\u30e2\u3092\u66f8\u304d\u7559\u3081\u3066\u304a\u304f\u30da\u30fc\u30b8\u3067\u3059\u3002\u5c06\u6765\u6574\u7406\u3059\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001\u73fe\u6642\u70b9\u3067\u306f\u3064\u3089\u3064\u3089\u3068\u66f8\u304d\u9023 \u2026<\/p>\n","protected":false},"author":1,"featured_media":850,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[136,247],"class_list":{"0":"post-1452","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-develop","8":"tag-android","9":"tag-java"},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/1452","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1452"}],"version-history":[{"count":9,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/1452\/revisions"}],"predecessor-version":[{"id":2186,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/posts\/1452\/revisions\/2186"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=\/wp\/v2\/media\/850"}],"wp:attachment":[{"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1452"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1452"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bunktiruu.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1452"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}