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

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

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

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

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

Android Studio

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

Q&A

1回答

541閲覧

viewPager(Fragment)を使う時に、その下にtextを表示したい

atatatatata

総合スコア77

Java

Javaは、1995年にサン・マイクロシステムズが開発したプログラミング言語です。表記法はC言語に似ていますが、既存のプログラミング言語の短所を踏まえていちから設計されており、最初からオブジェクト指向性を備えてデザインされています。セキュリティ面が強力であることや、ネットワーク環境での利用に向いていることが特徴です。Javaで作られたソフトウェアは基本的にいかなるプラットフォームでも作動します。

Android

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

Android Studio

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

0グッド

0クリップ

投稿2018/01/11 13:02

編集2018/01/11 13:57

このようにviewPagerを設置した場合、その下のtextViewが画面に表示されないのはなぜなのでしょうか?heightはwrap_contentを指定しています。

なぜかこのようにviewPagerがlayoutを占めてしまい、その下に指定したtextが表示されません。

<?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.android.sample.keiba.CalcActivity"> <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="horizontal"> <Button android:id="@+id/pushRaceOrderButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="出走表" /> <Button android:id="@+id/pushCalcButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="予想画面" /> <Button android:id="@+id/pushTotalButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="スコア一覧" /> <Button android:id="@+id/pushChatButton" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:text="チャット" /> <Button android:id="@+id/pushAccountButton" android:layout_width="0dp" android:layout_height="wrap_content" android:layout_weight="1" android:text="アカウント" /> </LinearLayout> <android.support.v7.widget.Toolbar android:id="@+id/tool_bar" android:layout_width="match_parent" android:layout_height="wrap_content" android:minHeight="?attr/actionBarSize" > <LinearLayout android:layout_width="match_parent" android:layout_height="wrap_content"> <Spinner android:id="@+id/raceSpinner" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:paddingLeft="10dp" android:popupBackground="#ccffffff" /> <Spinner android:id="@+id/hourseSpinner" android:layout_width="0dp" android:layout_weight="1" android:layout_height="wrap_content" android:paddingLeft="10dp" android:popupBackground="#ccffffff" /> </LinearLayout> </android.support.v7.widget.Toolbar> <!--この下のviewPagerにスクロールをつけて、そのweightをセットする--> <android.support.v4.view.ViewPager android:id="@+id/pager" android:layout_width="wrap_content" android:layout_height="wrap_content" /> <GridLayout android:id="@+id/number_input" android:layout_width="match_parent" android:layout_height="wrap_content" android:columnCount="6" android:rowCount="3"> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="1" android:layout_column="1" android:layout_row="1" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="2" android:layout_column="2" android:layout_row="1" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="3" android:layout_column="3" android:layout_row="1" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="4" android:layout_column="4" android:layout_row="1" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="5" android:layout_column="5" android:layout_row="1" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="6" android:layout_column="1" android:layout_row="2" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="7" android:layout_column="2" android:layout_row="2" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="8" android:layout_column="3" android:layout_row="2" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="9" android:layout_column="4" android:layout_row="2" android:textSize="15sp"/> <Button android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="10" android:layout_column="5" android:layout_row="2" android:textSize="15sp"/> </GridLayout> </LinearLayout>

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

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

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

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

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

yona

2018/01/11 13:53

レイアウトファイルを省略せずに記載してください。
atatatatata

2018/01/11 13:57

修正いたしました。申し訳ありませんでした。
guest

回答1

0

TextViewが無いからですね。
他のViewを消して試してください。

投稿2018/01/11 16:17

yona

総合スコア18155

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問