質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.51%
Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

Q&A

解決済

2回答

18661閲覧

Android レイアウト 右寄せの方法

netcafeohashi

総合スコア13

Android

Androidは、Google社が開発したスマートフォンやタブレットなど携帯端末向けのプラットフォームです。 カーネル・ミドルウェア・ユーザーインターフェイス・ウェブブラウザ・電話帳などのアプリケーションやソフトウェアをひとつにまとめて構成。 カーネル・ライブラリ・ランタイムはほとんどがC言語/C++、アプリケーションなどはJavaSEのサブセットとAndroid環境で書かれています。

1グッド

0クリップ

投稿2016/03/28 13:31

編集2016/03/28 20:05

Android レイアウトについて質問です。
下記のレイアウトの中のButtonを右寄せにしたいのですが、
うまくいきません。

なにか方法は無いでしょうか。

XML

1<?xml version="1.0" encoding="UTF-8"?> 2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="wrap_content" 4 android:layout_height="wrap_content" 5 android:paddingTop="10dp" 6 android:paddingBottom="30dp" 7 android:background="@drawable/spot_bubble" 8 android:orientation="horizontal"> 9 10 <ImageView android:id="@+id/bubble_image" 11 android:layout_width="0dp" 12 android:layout_height="0dp" 13 android:visibility="gone" /> 14 <LinearLayout 15 android:layout_width="wrap_content" 16 android:layout_height="wrap_content" 17 android:orientation="vertical"> 18 <LinearLayout 19 android:layout_width="wrap_content" 20 android:layout_height="wrap_content" 21 android:orientation="horizontal" > 22 <TextView android:id="@+id/bubble_title" 23 android:layout_width="wrap_content" 24 android:layout_height="wrap_content" 25 android:textColor="#585858" 26 android:maxEms="17" 27 android:text="Title" /> 28 </LinearLayout> 29 <TextView android:id="@+id/bubble_description" 30 android:layout_width="wrap_content" 31 android:layout_height="wrap_content" 32 android:textColor="#585858" 33 android:textSize="12dp" 34 android:maxEms="17" 35 android:text="Description" 36 android:visibility="gone" /> 37 38 <TextView android:id="@+id/bubble_subdescription" 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:textColor="#585858" 42 android:textSize="10dp" 43 android:maxEms="17" 44 android:text="Address" 45 android:visibility="gone" /> 46 </LinearLayout> 47 <Button android:id="@+id/balloon_alow" 48 android:background="@drawable/alow_wh" 49 android:visibility="visible" 50 android:layout_width="10dp" 51 android:layout_height="15dp" 52 android:layout_gravity="right" /> 53</LinearLayout>

イメージ説明

スクショはこちらになります。
矢印の画像を出来れば右、
テキストを左にもっていきたいです。

kuwako👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

2つめの LinearLayout(TextView 3つを内包しているレイアウト)に
layout_weight="1" を設定してみてはどうでしょうか。

投稿2016/03/29 00:16

ttoonnaa

総合スコア57

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

netcafeohashi

2016/03/29 15:30

できました!ありがとうございます。
guest

0

一番外側のLinearLayoutのlayout_widthにmatch_parentを設定するとどうなりますか?

スクショを追加してもらえないですか。

投稿2016/03/28 14:17

yona

総合スコア18155

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

yona

2016/03/29 01:23

RelativeLayoutを使った方が簡単にできそうですね。
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.51%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問