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

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

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

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

Q&A

0回答

2895閲覧

Android ScrollViewでRecyclerViewを含むLinearLayoutすべてをスクロールさせたい

shotakeu

総合スコア386

Android

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

0グッド

0クリップ

投稿2015/12/28 01:32

編集2022/01/12 10:55

xml

1<?xml version="1.0" encoding="utf-8"?> 2<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 xmlns:tools="http://schemas.android.com/tools" 4 android:layout_width="match_parent" 5 android:layout_height="match_parent" 6 android:background="@color/white"> 7 8 <ScrollView 9 android:layout_width="match_parent" 10 android:layout_height="match_parent" 11 android:fillViewport="true"> 12 13 <LinearLayout 14 android:layout_width="match_parent" 15 android:layout_height="match_parent" 16 android:orientation="vertical"> 17 18 <LinearLayout 19 android:id="@+id/ll_share_module" 20 android:layout_width="match_parent" 21 android:layout_height="50dp" 22 android:background="@color/white" 23 android:orientation="horizontal" 24 android:weightSum="1"> 25 26 <TextView 27 android:layout_width="wrap_content" 28 android:layout_height="wrap_content" 29 android:layout_marginBottom="15dp" 30 android:layout_marginLeft="15dp" 31 android:layout_marginTop="16dp" 32 android:layout_weight="0.95" 33 android:text="aaaaaa" 34 android:textColor="#333333" 35 android:textSize="17dp" /> 36 37 <Button 38 android:id="@+id/ib_share_button" 39 android:layout_width="wrap_content" 40 android:layout_height="wrap_content" 41 android:layout_alignParentRight="true" 42 android:layout_marginBottom="15dp" 43 android:layout_marginRight="5dp" 44 android:layout_marginTop="16dp" 45 android:background="@drawable/ic_share_sales_promotion" /> 46 47 <TextView 48 android:layout_width="wrap_content" 49 android:layout_height="wrap_content" 50 android:layout_marginBottom="15dp" 51 android:layout_marginTop="16dp" 52 android:text="share" 53 android:textColor="#808080" 54 android:textSize="14dp" /> 55 56 </LinearLayout> 57 58 59 <android.support.v4.widget.SwipeRefreshLayout 60 android:id="@+id/srl_container" 61 android:layout_width="match_parent" 62 android:layout_height="match_parent"> 63 64 65 <FrameLayout 66 android:layout_width="match_parent" 67 android:layout_height="match_parent"> 68 69 70 <android.support.v7.widget.RecyclerView xmlns:tools="http://schemas.android.com/tools" 71 android:id="@+id/rv_sales" 72 android:layout_width="match_parent" 73 android:layout_height="wrap_content" 74 android:layout_gravity="center_horizontal|bottom" 75 tools:context=".TopFragment" /> 76 77 78 </FrameLayout> 79 </android.support.v4.widget.SwipeRefreshLayout> 80 81 </LinearLayout> 82 </ScrollView> 83 84 <include layout="@layout/list_counter"></include> 85 86 87</RelativeLayout>

上記のようなScrollViewを設定すると、RecyclerViewの部分しかスクロールしません。

<LinearLayout android:id="@+id/ll_share_module"

この部分も一緒にスクロールしてほしいのですが、それは可能でしょうか。
ご存知の方いらっしゃいましたらご教示ください。

■追記
おそらくScrollViewとRecyclerViewのスクロールがあってRecyclerViewのスクロールが優先されてしまっているとは思うのですが・・・

■追記2016.01.08
RecyclerView内部に

<LinearLayout android:id="@+id/ll_share_module"

を持たせることで一旦解決させましたが、根本的な解決になっていないため回答者を募集しております。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

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

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

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

ただいまの回答率
85.51%

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

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

質問する

関連した質問