Can't use srcCompat for ImageViews in android

前端 未结 12 559
借酒劲吻你
借酒劲吻你 2020-12-03 00:38

I\'m using the Design Support Library 23.2. I\'ve added these lines in my build.gradle as my Gradle Plugin is version 1.5

defaultConfig {
        applicat         


        
12条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 01:02

    Make sure the picture you are trying to use is PNG format.

    Copy the picture.

    Go to mipmap on the 1.Project TAB in the android hierarchy.

    Click on mipmap once then(On windows ctrl + v ), when you name the photo make sure its lower case letters and no symbols.

    The photo should be useable.

    Set your image view, (you may have to use a filler color temporarily).

    Click on the imageView and then click the srcCompact (the one without the paintbrush and type on @mipmap/"Your pictures name" (This step is in the attributes tab)

    That should work!

    If you need a Content Description I just used @String/StringPicture

提交回复
热议问题