Android: Drawable not showing up

前端 未结 7 1708
鱼传尺愫
鱼传尺愫 2021-02-06 03:46

I have a fairly simple xml file that has an image button in it. The image shows up fine on the Graphical Layout xml designer, shows up fine when I run a development build, but a

7条回答
  •  庸人自扰
    2021-02-06 04:22

    My situation was weird.Everything was correct until integrating FireBase Crash report to my Application.

    I just added compile 'com.google.firebase:firebase-crash:11.0.1' & DrawableLeft vanished .When i went through the xml , noticed a warning (In lined below).

    So added android:drawableStart & issue gone.

    Still I am wondering about the relation of FireBase Crash reporting to the same.

    Using left/right instead of start/end attributes Using Gravity#LEFT and Gravity#RIGHT can lead to problems when a layout is rendered in locales where text flows from right to left. Use Gravity#START and Gravity#END instead.

    Similarly, in XML gravity and layout_gravity attributes, use start rather than left. For XML attributes such as paddingLeft and layout_marginLeft, use paddingStart and layout_marginStart.

    NOTE: If your minSdkVersion is less than 17, you should add both the older left/right attributes as well as the new start/right attributes. On older platforms, where RTL is not supported and the start/right attributes are unknown and therefore ignored, you need the older left/right attributes.

    There is a separate lint check which catches that type of error. (Note: For Gravity#LEFT and Gravity#START, you can use these constants even when targeting older platforms, because the start bitmask is a superset of the left bitmask. Therefore, you can use gravity="start" rather than gravity="left|start".)

提交回复
热议问题