小编ali*_*awi的帖子

在Constraint布局中将RecyclerView的高度设置为"wrap_content"

我正在尝试在wrap_content上设置回收器视图的高度并使其尊重,但它将超过布局上的其他窗口小部件.我现在能做什么?

<android.support.constraint.ConstraintLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@color/white">



    <TextView
        android:id="@+id/tvPastRounds"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="16dp"
        android:layout_marginTop="0dp"
        android:text="Past Rounds"
        android:textColor="@color/text_color_black"
        android:textSize="16sp"
        app:layout_constraintLeft_toLeftOf="parent"/>
    <android.support.v7.widget.RecyclerView
        android:id="@+id/recycler_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginBottom="24dp"
        android:layout_marginEnd="8dp"
        android:layout_marginRight="8dp"
        android:layout_marginTop="16dp"
        android:clipChildren="true"
        android:maxHeight="150dp"

        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintHorizontal_bias="0.0"
        app:layout_constraintLeft_toLeftOf="@+id/tvPastRounds"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/tvPastRounds" app:layout_constraintVertical_bias="0.0"/>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud)

android android-recyclerview android-constraintlayout

21
推荐指数
2
解决办法
1万
查看次数

android上的flutter闪屏跳转

我想在颤振中实现我的启动画面。正如这里提到的,我在styles.xml文件中创建了我的 splashScreen 主题并放置了以下代码:

<style name="LaunchTheme" parent="@android:style/Theme.Black.NoTitleBar">
    <item name="android:windowBackground">@drawable/launch_background</item>
</style>
Run Code Online (Sandbox Code Playgroud)

launch_background文件中我把这些代码:

<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/black" />
<item>
    <bitmap
        android:gravity="center"
        android:src="@drawable/ic_splash" />
</item>
Run Code Online (Sandbox Code Playgroud)

我启动了该应用程序,在加载背景后,我遇到了居中徽标图像的“跳跃”。我该如何解决这个跳跃?

flutter flutter-layout

4
推荐指数
2
解决办法
1128
查看次数