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

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

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

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

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

Q&A

解決済

1回答

3671閲覧

android Listviewタップできる範囲を変えるには?

masaakitsuyoshi

総合スコア102

Android

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

Android Studio

Android Studioは、 Google社によって開発された、 Androidのネイティブアプリケーション開発に特化した統合開発ツールです。

0グッド

0クリップ

投稿2016/03/29 10:11

リストビューが、文字のところしかタップの反応しません。

参考
http://blog.bgbgbg.net/archives/1949

layaout_widthをmatch_parentにしているのですが、反映されていない??

listviewも、テキストビューもmatch_parentにしたのですが変わらないようです。

なぜでしょうか?

イメージ説明
カスタムレイアウト

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="horizontal" android:layout_width="wrap_content" android:layout_height="wrap_content" > <ImageView android:id="@+id/image" android:layout_width="60dip" android:layout_height="60dip" android:src="@drawable/logo" /> <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:id="@+id/text" android:choiceMode="singleChoice" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="名前" android:layout_marginTop="10dp" android:layout_marginLeft="10dp" /> <TextView android:id="@+id/text2" android:choiceMode="singleChoice" android:layout_width="match_parent" android:layout_height="wrap_content" android:text="役職名" android:textSize="12sp" android:layout_marginLeft="10dp" /> </LinearLayout> </LinearLayout>

content_main.xml

<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" app:layout_behavior="@string/appbar_scrolling_view_behavior" tools:context="com.example.tsuyoshiokaprofile.Main" tools:showIn="@layout/activity_main" android:orientation="horizontal" android:weightSum="1"> <ListView android:layout_width="match_parent" android:layout_height="match_parent" android:id="@+id/listView1" android:layout_above="@+id/button1"/> <Button android:layout_width="match_parent" android:layout_height="55dp" android:text="Button" android:id="@+id/button1" android:layout_alignParentBottom="true"/> </RelativeLayout>

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

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

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

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

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

guest

回答1

0

ベストアンサー

ここの変更を見落としていますが

xml

1<?xml version="1.0" encoding="utf-8"?> 2<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:orientation="horizontal" 4 android:layout_width="wrap_content" 5 android:layout_height="wrap_content" 6 >

wrap_contentからmatch_parentに変更です

投稿2016/03/29 10:25

aja

総合スコア3733

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問