项目里的shape.xmlselector.xmllayer_list.xml文件太多啦想个办法替代吧:1.shape.xml的替代法旧写法-shape.xml新写法-kotlintextView.background=shape{shape=RECTANGLEsolid{color=Color.parseColor("#f00000")}corners{radius=15f.dp}}xml里所有的属性都支持2.selector.xml的替代法旧写法-selector.xmlnormal.xmlpressed.xmlselector.xml新写法-kotlintextView.backgrou
项目里的shape.xmlselector.xmllayer_list.xml文件太多啦想个办法替代吧:1.shape.xml的替代法旧写法-shape.xml新写法-kotlintextView.background=shape{shape=RECTANGLEsolid{color=Color.parseColor("#f00000")}corners{radius=15f.dp}}xml里所有的属性都支持2.selector.xml的替代法旧写法-selector.xmlnormal.xmlpressed.xmlselector.xml新写法-kotlintextView.backgrou
效果前言先来看一下MaterialButton是什么由上图可以看到MaterialButton也没有什么神秘的,不过是Button的一个子类而已,但是经过谷歌的封装之后,在符合MaterialDesign的基础上,使用起来更加方便了,且容易实现预期效果。使用引入material包implementation'com.google.android.material:material:1.2.1'常规android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="
效果前言先来看一下MaterialButton是什么由上图可以看到MaterialButton也没有什么神秘的,不过是Button的一个子类而已,但是经过谷歌的封装之后,在符合MaterialDesign的基础上,使用起来更加方便了,且容易实现预期效果。使用引入material包implementation'com.google.android.material:material:1.2.1'常规android:layout_width="wrap_content"android:layout_height="wrap_content"android:text="
效果前言先来看一下ShapeableImageView是什么由上图可以看到ShapeableImageView也没有什么神秘的,不过是ImageView的一个子类而已,但是从效果图来看,在不写shape、不引入三方库的情况下,还是挺容易实现预期效果的,而且扩展性良好。使用引入material包implementation'com.google.android.material:material:1.2.1'常规android:layout_width="wrap_content"android:layout_height="wrap_content"an
效果前言先来看一下ShapeableImageView是什么由上图可以看到ShapeableImageView也没有什么神秘的,不过是ImageView的一个子类而已,但是从效果图来看,在不写shape、不引入三方库的情况下,还是挺容易实现预期效果的,而且扩展性良好。使用引入material包implementation'com.google.android.material:material:1.2.1'常规android:layout_width="wrap_content"android:layout_height="wrap_content"an