Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

徽章显示在了图片的中间而不是右上角 #75

Open
HenryWu01 opened this issue Oct 8, 2022 · 0 comments
Open

徽章显示在了图片的中间而不是右上角 #75

HenryWu01 opened this issue Oct 8, 2022 · 0 comments

Comments

@HenryWu01
Copy link

我的布局是这样的

<androidx.cardview.widget.CardView
        android:layout_width="match_parent"
        android:layout_height="67dp"
        android:layout_marginTop="11dp"
        android:layout_marginLeft="13dp"
        android:layout_marginRight="13dp"
        app:cardBackgroundColor="#ffffff"
        app:cardCornerRadius="8dp"
        app:cardElevation="0dp">

        <LinearLayout
            android:orientation="horizontal"
            android:gravity="center_vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">

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

                <cn.bingoogolapple.badgeview.BGABadgeImageView
                    android:id="@+id/like_badge"
                    android:layout_width="24dp"
                    android:layout_height="22dp"
                    android:src="@drawable/ic_like_black" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="7dp"
                    android:text="点赞与喜欢"
                    android:textColor="#313131"
                    android:textSize="10sp" />

            </LinearLayout>

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

                <cn.bingoogolapple.badgeview.BGABadgeImageView
                    android:layout_width="24dp"
                    android:layout_height="22dp"
                    android:src="@drawable/ic_comment_black" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="7dp"
                    android:text="评论"
                    android:textColor="#313131"
                    android:textSize="10sp" />

            </LinearLayout>

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

                <cn.bingoogolapple.badgeview.BGABadgeImageView
                    android:layout_width="24dp"
                    android:layout_height="22dp"
                    android:src="@drawable/ic_follow_black" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="7dp"
                    android:text="关注"
                    android:textColor="#313131"
                    android:textSize="10sp" />

            </LinearLayout>

        </LinearLayout>

    </androidx.cardview.widget.CardView>

image

徽章应该显示在右上角却显示在图片的中间

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant