2017-11-21 16 views
0

私はアンドロイドが新しく、miフラグメントの2つのレイアウトに問題があります。常に上にあるLinearLayoutと、Scrollviewです。問題は、ScrollViewが完全にスクロールせず、 "final"というテキストのボタンが表示されないことです。私がいた:ScrollViewがダウンして行くことができない点では、私が簡単であると確信しているが、私はどこにでもフラグメント内のScrollViewは完全にスクロールしません

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
xmlns:tools="http://schemas.android.com/tools" 
xmlns:app="http://schemas.android.com/apk/res-auto" 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:background="#ffffff" 
android:id="@+id/relative2" 
android:orientation="vertical"> 

<RelativeLayout 
android:layout_width="match_parent" 
android:layout_height="wrap_content" 
> 
<TextView 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:text="Ajustes" 
    android:textSize="40sp" 
    android:layout_marginLeft="10dp" 
    android:layout_marginTop="30dp" 
    android:textColor="#004667" 
    android:textStyle="bold"/> 
<RelativeLayout 
    android:layout_marginTop="110dp" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:background="#004667" 
    android:id="@+id/rel21"> 


    <TextView 
     android:id="@+id/textView2" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:layout_alignParentStart="true" 
     android:layout_alignParentTop="true" 
     android:text="Name" 
     android:textColor="#FFFFFF" 
     android:layout_marginStart="38dp"/> 

    <TextView 
     android:id="@+id/textView3" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentStart="true" 
     android:layout_marginTop="15dp" 
     android:layout_marginStart="38dp" 
     android:text="Email" 
     android:textColor="#FFFFFF"/> 

    <ImageView 
     android:id="@+id/imageView2" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:layout_alignParentStart="true" 
     app:srcCompat="@drawable/user" /> 
</RelativeLayout> 
</RelativeLayout> 

<ScrollView 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:fillViewport="true"> 



<LinearLayout 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:orientation="vertical" 
    android:id="@+id/linear" 
    > 
    <Button 
     android:id="@+id/button6" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="Button" /> 
    <Button 
     /> 
    <Button 
     /> 
    <Button 
     /> 
    <Button 
     /> 

    <Button 
     /> 
    <Button 
     /> 
    <Button 
     android:id="@+id/ad" 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:text="final" /> 

</LinearLayout> 

</ScrollView> 



</LinearLayout> 

enter image description here

EDIT答えを見つけるcouldntの、問題が何であるかを知りませんBottomNavigationBarを使用して、最後のボタンが覆われていたので、layout_marginBottomをscrollviewに追加しました。ありがとう:あなたはScrollviewにプロパティを追加してくださいビューの下部にスクロールするためのD

+0

テストケース削除**アンドロイド:あなたの** 'ScrollView'からfillViewport = "true" を** **より – Prem

+0

あなたのレイアウトが正しく更新Javaコードであるとしてみてください。.. –

答えて

0

、持って見て:

<ScrollView 
android:layout_width="match_parent" 
android:layout_height="match_parent" 
android:focusable="true" 
android:focusableInTouchMode="true" 
android:fillViewport="true"> 
</ScrollView> 

とフラグメントで行います

scrollview.scrollTo(0, scrollview.getBottom()); 
コーディング

ハッピー!!

0

問題は、上部レイアウトがすべての領域を占有しており、スクロールビューが表示されないことです。この問題を解決するには、wrap_contentではなくheightを指定します。例えば

<RelativeLayout 
     android:id="@+id/rel21" 
     android:layout_width="match_parent" 
     android:layout_height="300dp" 
     android:layout_marginTop="110dp" 
     android:background="#004667"> 
関連する問題