• ベストアンサー

Eclipseのボタンに日本語を表示

Eclipse(pleiades)を使用して、Androidアプリの練習をしているのですが、 ボタンを配置し、TEXTプロパティーを日本語で入力すると正しく表示されません。 入力文字:「現在日時」 Layout width:wrap_content Layout height:wrap_content ボタンのテキストプロパティに日本語で入力すると、うまくwrapされていない感じです。 縦に押しつぶされている感じです。 何か設定が必要なのでしょうか? アドバイスよろしくお願いいたします。

質問者が選んだベストアンサー

  • ベストアンサー
noname#161640
noname#161640
回答No.1

よくわからないのですが、ただ単にデザイン画面がうまく表示されないだけで、実際にできたプログラムはちゃんと動きませんか。 main.xmlにレイアウトを記述する場合、直接テキストを設定するのではなく、strings.xmlに用意したテキストを@+id/~で指定するのが一般的でしょう。ですので、直接レイアウトツールに日本語を書くようなやり方にツールが対応してないだけではないでしょうか。

abuhiro
質問者

お礼

早々のアドバイスありがとうございます。 プログラムを実行したところキチンと表示されました。 レイアウトの表示が縦長になっており、非常に気持ち悪いレイアウトになっています。 このまま使用するしか無さそうですね。 ありがとうございました。

関連するQ&A

  • マップとボタン同時表示|AndroidStudio

    下記のサイトを参考にしてボタンとマップを同時に表示させるxmlを記述したつもりなのですが、 実行すると一瞬だけボタンが映り、その後はマップのみが表示されました。 https://groups.google.com/forum/?hl=ja&fromgroups#!topic/shikokugtug/NGseYmNKQQQ 何がおかしいのでしょうか。 記述したxmlは以下の通りです。 ちなみにfragmentをwrap_contentに変更しても同じでした。 <FrameLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="match_parent" android:layout_width="match_parent"> <fragment xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" tools:context="com.example.~.MapsActivity" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" android:name="com.google.android.gms.maps.SupportMapFragment" /> <LinearLayout android:id="@+id/level" android:layout_width="match_parent" android:layout_height="wrap_content"> <Button android:id="@+id/large_up" android:text="@string/large_up" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/large_down" android:text="@string/large_down" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/small_down" android:text="@string/small_down" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <Button android:id="@+id/small_up" android:text="@string/small_up" android:layout_width="wrap_content" android:layout_height="wrap_content"/> </LinearLayout> </FrameLayout>

  • Androidのレイアウトについて

    こんばんは ちょっとアンドロイドのレイアウトでちょっと戸惑って質問来ました。 添付画像のように画像の横のテキストを2行(本来は右より)で配置したいのですが、うまく設定出来ません。 TableLayoutをどういじってもダメ 泣 AbsoluteLayoutを見つけましたが、上部のテキストが長い時に使えない事がわかりどうしようもありません。 どのようにしたら、画像の横にテキスト行をニ行置けるでしょうか? <TableLayout android:layout_height="wrap_content" android:id="@+id/tableLayout1" android:layout_width="fill_parent"> <TableRow android:id="@+id/tableRow1" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:id="@+id/imageView1" android:src="@drawable/icon" android:layout_height="wrap_content"></ImageView> <LinearLayout android:id="@+id/linearLayout5" android:layout_width="wrap_content" android:layout_height="wrap_content"> <TextView android:text="TextView" android:layout_width="wrap_content" android:id="@+id/textView5" android:layout_height="wrap_content"></TextView> </LinearLayout> <TextView android:text="TextView" android:id="@+id/textView6" android:layout_width="wrap_content" android:layout_height="wrap_content"></TextView> </TableRow> </TableLayout> 取り敢えず今の問題の所が上です。 【知りたい事】 画像の横にニ行以上テキストを配置したい。 【やった事】 いろいろやり過ぎて書ききれません 泣 【開発環境】 Eclipse 何卒お知恵を貸してください。お願します。

    • ベストアンサー
    • XML
  • eclipseで表示されるJavadocのツールチップが日本語で表示できない

     eclipse Europaで、pleiadesによる日本語化環境で開発しています。  eclipseにはメソッドなどの上にマウスをおくと、そのメソッドなどのJavadocが表示されるようになっていますが、プロジェクト > プロパティ > javadocロケーション で日本語のJava APIドキュメントを指定している(検証済み)にもかかわらず、これが日本語で表示されません。  これの改善策はありますでしょうか? pleiadesで日本語化しているために、eclipseが、使用している言語を英語であると認識してしまっているのかとも思いましたが・・・。

    • ベストアンサー
    • Java
  • androidプログラムのエラーについて

    自分は今、本を読みながらandroidプログラミングの勉強をしています。 XMLファイルをよく見直して間違いは見当たらないのですが 起動しようとすると「your project contains error」と表示されます。 コンソールには「No resource found that matches the given name (at 'title' with value '@string/menu_settings')」と書いてあります。 ネットで調べたらソースをクリーンすればいいと書いてありましたが クリーンすると今度はjavaファイルにエラーが起きます。 以下が自分が打ち込んだXMLのソースコードです。 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent"> <TextView android:text="お申込みフォーム" android:textAppearance="?android:attr/textAppearanceLarge" android:layout_width="fill_parent" android:layout_height="wrap_content"/> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:text="お名前 :" android:layout_width="70sp" android:layout_height="wrap_content"/> <EditText android:id="@+id/name" android:layout_width="200dp" android:layout_height="wrap_content"/> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:text="住所 :" android:layout_width="70sp" android:layout_height="wrap_content"/> <EditText android:id="@+id/address" android:layout_width="200dp" android:layout_height="wrap_content"/> </LinearLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content"> <TextView android:text="生年月日 :" android:layout_width="70sp" android:layout_height="wrap_content"/> <Spinner android:id="@+id/month" android:entries="@array/month" android:layout_width="85dp" android:layout_height="wrap_content"/> <TextView android:text="月" android:layout_width="20sp" android:layout_height="wrap_content"/> <Spinner android:id="@+id/day" android:entries="@array/day" android:layout_width="85dp" android:layout_height="wrap_content"/> <TextView android:text="日" android:layout_width="20sp" android:layout_height="wrap_content"/> </LinearLayout> </LinearLayout> どうかよろしくお願い致します。

  • eclipseを日本語化したのに一部がまだ英語

    eclipseをpleiadesで日本語化したのに一部日本語化されていない。 なぜか(java)プロジェクトのプロパティーを選択して 表示されるとなぜか英語になってしまいます。 でも何か変なんです。 左のいろいろな項目が並んで選択できるところは英語なのに 右の詳しい設定みたいなところは しっかり日本語なんです。 これはどういうことでしょうか? 教えてください! おねがいします!

    • ベストアンサー
    • Java
  • eclipse アンドロイドアプリ 作り方

    ゲームを作りたいと考えているのですが  SDKやらEclipseはダウンロードしたのですが eclipseのxmlがどこにあるのかがわかりません 本にはandroidmanifestxmlにandroid:screenOrientation="portrait"を追加すると書いてあります もう一つはmain.xmlに<LinearLayout android;layout_width="wrap_content" が(追加する?)書いてあるのですが、mainxmlがどこにも見当たりません   1 mainxmlはどこにありますか または名称が変わってる場合がありますか? 2 アプリをつくるにはmainxmlに上記のようなコードを入力していけば作れるのでしょうか? 大変困ってます

  • eclipse4.2 日本語化ができません。

    eclipse4.2の日本語化をHPを参照しながらやってみたのですが、 日本語化されませんでした。 解釈の間違えや、環境の不適合があればアドバイスいただきたいです。 OS:windows7 64bit javaは7u9をインストールしました。 やってみた作業は (1)eclipse-jee-juno-SR1-win32-x86_64を C:\Program Files\eclipse4.2に解凍  (C:\Program Files\eclipse4.2\eclipseにexeファイルなどが保管) (2)pleiades_1.3.4を解凍し、中身のfeatures、plugins、readmeフォルダと  eclipse.exe -cleanをeclipseフォルダ内に上書きで保管 (3)eclipse.iniをTeraPadで開き最後に  -javaagent:plugins/jp.sourceforge.mergedoc.pleiades/pleiades.jar  の記述を追加 (4)クリーン起動 結果 起動はしますが、メニューなど英語のままです。 参考までに参照したURLを↓に貼ります。 http://www.kkaneko.com/rinkou/javaintro/eclipse.html わかる人から見れば馬鹿らしい質問かもしれませんが、 ご助力お願いいたします。

    • ベストアンサー
    • Java
  • Eclipseの日本語化が不完全

    Eclipseをインストールし、Pleiadesで日本語化を行ったのですが、 エラー箇所にカーソルを置いた時に出るポップアップ形式の エラーメッセージが英語で表示されてしまいます。 この現象への対処方法がありましたらご教示願います。 又、LanguagePackの存在するEclipse3.2系にする事も考えましたが、 公式サイト「http://www.eclipse.org」から3.2のダウンロードが 出来る場所が見つからず断念致しました。 こちらもご存知でしたら併せてご教示願います。 問題の現象が発生するのは以下のバージョンです。 Eclipse SDK Version: 3.3.0 Pleiades   1.2.1.p4 以上、どうぞよろしくお願い致します。

    • ベストアンサー
    • Java
  • Android開発についての初心者質問です。

    Android開発についての質問です。初心者でAndroidアプリを作っています。 初心者でAndroidアプリを作っています。 XMLからの実装をしたいのですが、 やり方がよく分かりません。 どなたかご教授頂けないでしょうか? よろしくお願いいたします。 やりたいことは、imageButtonをクリックしたら imageViewの画像部分が変わる。 imageButton1をクリック → imageView1が表示 imageButton2をクリック → imageView2が表示 デフォルトでは、imageView1が表示している状態 buttonのリスナーを登録するのが関の山で、ボタンクリック時の imageView表示切替処理等ちんぷんかんぷんです。 XMLはこういった感じで書いてます。 よろしくお願いいたします。 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content"> <FrameLayout android:id="@+id/frameLayout1" android:layout_height="wrap_content" android:foregroundGravity="center" android:layout_width="match_parent" > <ImageView android:layout_height="wrap_content" android:src="@drawable/icon" android:id="@+id/imageView1" android:layout_gravity="center" android:layout_width="match_parent" > </ImageView> </FrameLayout> <LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="match_parent" > <ImageButton android:id="@+id/imageButton1" android:layout_height="wrap_content" android:src="@drawable/icon" android:layout_width="wrap_content" > </ImageButton> <ImageButton android:id="@+id/imageButton2" android:layout_width="wrap_content" android:src="@drawable/icon" android:layout_height="wrap_content" > </ImageButton> <ImageButton android:id="@+id/imageButton3" android:layout_width="wrap_content" android:src="@drawable/icon" android:layout_height="wrap_content" > </ImageButton> </LinearLayout> </LinearLayout>

  • eclipseの新規作成で、最初に出てくるソースについて

    eclipseの新規作成で、最初に出てくるソースについて 超素人です。どなたかこちらの解説をしていただけないでしょうか…? importやpublic、@Overrideの意味とか… package com.pikopiko; import android.app.Activity; import android.os.Bundle; public class yukari2 extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); } } そしてデジタル時計を作ってみたいのですが、下のコードはどこに記述すればいいのでしょうか? <DigitalClock android:id="@+id/DigitalClock" android:layout_width="wrap_content" android:layout_height="wrap_content"/>