小编j0c*_*chn的帖子

ScrollView布局不会填满整个屏幕

我得到一个Activity两个Fragments(一个列表一个正常).正常Fragment膨胀Scrollview包含a LineaLayout(垂直)并且此布局包含TextViews.在ScrollViewlayout_widthlayout_heightmatch_parent,所以我觉得整个画面应该被使用.但在底部仍然存在"差距".我希望你能帮助我.

ScrollView.xml

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/scrollView1"
android:layout_width="match_parent"
android:layout_height="match_parent">

<LinearLayout
    android:id="@+id/LinearLayout1"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/titlescreen_bg"
    android:orientation="vertical"
    android:paddingTop="60dp"
    tools:context=".MainActivity" >

    <TextView
        android:id="@+id/tv_headline"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:gravity="center"
        android:paddingBottom="60dp"
        android:paddingTop="60dp"
        android:textIsSelectable="false"
        android:textSize="@dimen/fontsize_slogan_titlescreen" />

    <TextView
        android:id="@+id/tv_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:paddingBottom="30dp"
        android:paddingTop="30dp"
        android:textIsSelectable="false"
        android:textSize="@dimen/fontsize_slogan_titlescreen" />
</LinearLayout>

</ScrollView>
Run Code Online (Sandbox Code Playgroud)

膨胀这种布局的片段.

package wak.iage.layout;

import wak.iage.R;
import android.app.Fragment;
import android.graphics.Color;
import android.graphics.Typeface;
import android.os.Bundle;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup; …
Run Code Online (Sandbox Code Playgroud)

android android-layout android-fragments

66
推荐指数
2
解决办法
6万
查看次数