Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

FixLayoutHelper不支持constraintLayout里面的0dp #497

Open
leenickcode opened this issue Apr 26, 2020 · 0 comments
Open

FixLayoutHelper不支持constraintLayout里面的0dp #497

leenickcode opened this issue Apr 26, 2020 · 0 comments

Comments

@leenickcode
Copy link

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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:layout_width="match_parent"
    android:layout_height="wrap_content">



    <LinearLayout
        android:id="@+id/linearLayout"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/tv_add_car"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:id="@+id/ll_call"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/iv_call"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"

               android:src="@mipmap/add_bank" />

            <TextView
                android:id="@+id/tv_call"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="联系客服" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:gravity="center"
            android:id="@+id/ll_collection"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/iv_collection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@mipmap/add_bank" />

            <TextView
                android:id="@+id/tv_collection"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="关注" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="wrap_content"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:id="@+id/ll_shopping_car"
            android:orientation="vertical">

            <ImageView
                android:id="@+id/imageView5"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:src="@mipmap/add_bank" />

            <TextView
                android:id="@+id/textView10"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center"
                android:text="购物车" />
        </LinearLayout>
    </LinearLayout>
    <TextView
        android:id="@+id/tv_add_car"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginStart="8dp"
        android:layout_marginEnd="8dp"
        android:background="@drawable/bg_conner_add_car"
        android:padding="@dimen/dp_5"
        android:text="加入购物车"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toStartOf="@+id/tv_pay"
        app:layout_constraintHorizontal_bias="0.5"
        app:layout_constraintStart_toEndOf="@+id/linearLayout"
        app:layout_constraintTop_toTopOf="parent" />

    <TextView
        android:id="@+id/tv_pay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_marginEnd="8dp"
        android:background="@drawable/bg_conner_pay"
        android:padding="@dimen/dp_5"
        android:text="立即结款"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>

布局如上,linerlayout的内容不会显示出来

    @Override
    public LayoutHelper onCreateLayoutHelper() {
        return new FixLayoutHelper(FixLayoutHelper.BOTTOM_LEFT,100,0);
    }
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant