【问题标题】:how to adjust flipper size in your android studio project?如何在你的 android studio 项目中调整脚蹼大小?
【发布时间】:2020-01-16 23:11:33
【问题描述】:

我想在我的主要活动页面中创建幻灯片。在我的应用程序中实现翻转器后,我注意到FlipperLayout 与我的小部件Toolbar 重叠。在我的小部件工具栏中包含用户名,当他们登录到应用程序时,我在其中调用用户全名。 我不太确定如何调整翻转器大小以确保幻灯片不会与我的工具栏重叠。我希望将脚蹼放在工具栏下方。谁能帮我 ?

 <FrameLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/frame_layout"
        android:layout_above="@id/btm_nav"
        >

        <androidx.appcompat.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/purpleBoo"
            android:minHeight="?attr/actionBarSize"
            android:theme="@style/ThemeOverlay.AppCompat.Dark" >

            <TextView
                android:id="@+id/tv_name"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="welcome"
                android:layout_gravity="center"
                android:textColor="@color/white">

            </TextView>

        </androidx.appcompat.widget.Toolbar>


        <technolifestyle.com.imageslider.FlipperLayout
            android:id="@+id/flipper"
            android:layout_width="match_parent"
            android:layout_height="219dp">

        </technolifestyle.com.imageslider.FlipperLayout>

【问题讨论】:

    标签: android-layout layout viewflipper flipper


    【解决方案1】:

    您可以编辑您的FlipperLayout 以添加android:layout_marginTop="?attr/actionBarSize" 属性

     <technolifestyle.com.imageslider.FlipperLayout
                android:id="@+id/flipper"
                android:layout_width="match_parent"
                android:layout_height="219dp"
                android:layout_marginTop="?attr/actionBarSize">
    

    您可以在布局的根部使用LinearLayout,而不是FrameLayout,使用android:orientation="vertical"。这是因为FrameLayout 用于需要子视图重叠的目的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-24
      • 2015-07-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多