Android Tabbed Activity Bottom off Screen

后端 未结 1 754
难免孤独
难免孤独 2021-01-20 13:51

anybody an idea why the bottom is off screen in a new generated tabbed activity in android?

ViewPager is too long for the total screen

    &         


        
相关标签:
1条回答
  • 2021-01-20 14:47

    Maybe this design will help in what you need, add:

    <LinearLayout
            android:id="@+id/test"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical">
    </LinearLayout>
    

    in your xml:

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout 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:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"
        tools:context="com.comfylight.bulbtest.FooBar">
    
        <LinearLayout
                    android:id="@+id/test"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:orientation="vertical">
    
        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:paddingTop="@dimen/appbar_padding_top"
            android:theme="@style/AppTheme.NoActionBar.AppBarOverlay">
    
            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/AppTheme.NoActionBar.PopupOverlay">
    
            </android.support.v7.widget.Toolbar>
    
            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
    
        </android.support.design.widget.AppBarLayout>
    
        <android.support.v4.view.ViewPager
            android:id="@+id/container"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />
    
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="end|bottom"
            android:layout_margin="@dimen/fab_margin"
            android:src="@android:drawable/ic_dialog_email" />
    
        </LinearLayout>
    </android.support.design.widget.CoordinatorLayout>
    

    0 讨论(0)
自定义标题
段落格式
字体
字号
代码语言
提交回复
热议问题