JavaNoober / BackgroundLibrary

A framework for directly generating shape through Tags, no need to write shape.xml again(通过标签直接生成shape,无需再写shape.xml)
Apache License 2.0
3.86k stars 469 forks source link

关于ImageView 失效问题 #82

Closed open9527 closed 5 years ago

open9527 commented 5 years ago

<ConstraintLayout android:layout_width="match_parent" android:layout_height="500dp" app:bl_corners_radius="@dimen/dp_20" app:bl_solid_color="@color/color_fff" app:bl_stroke_color="@color/color_eee">

<ImageView android:layout_width="match_parent" android:layout_height="400dp"/>

<TextView android:layout_width="match_parent" android:layout_height="100dp"/>

实现这个样一个父布局圆角,子布局上边是图片,下边是文本,发现图片上部分无法圆角, 目前发现 只能在image圆角上部分,textview圆角下部分才可以.

JavaNoober commented 5 years ago

把你使用的xml布局贴上来看一下

open9527 commented 5 years ago
            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="@dimen/dp_700"
                android:layout_margin="@dimen/dp_40"
                android:orientation="vertical"
                app:bl_corners_radius="@dimen/dp_20"
                app:bl_solid_color="@color/colorAccent"
                app:bl_stroke_color="@color/color_eee"
                app:bl_size_width="@dimen/dp_10"
                android:background="@color/color_5676fc"
                >

                <ImageView
                    android:layout_width="match_parent"
                    android:background="@color/color_999"
                    android:layout_height="@dimen/dp_600"/>

                <TextView
                    android:text="这是一段描述"
                    android:textColor="@color/color_333"
                    android:textSize="@dimen/dp_42"
                    android:gravity="center"
                    android:background="@color/color_999"
                    android:layout_width="match_parent"
                    android:layout_height="@dimen/dp_100" />

            </LinearLayout>
JavaNoober commented 5 years ago

background和bl属性不能同时设置