简体   繁体   中英

Can I put Drawable id in string.xml?

<string name="dm_icon">@drawable/qubic_icon</string>

While watching at my tutor's code, there was an red line error on

@drawable/qubic_icon

Is this a vaild xml code or not?

Or is there an alternative way to solve?

You can store R.drawable.qubic_icon in Strings.xml as an int

<integer name="qubic_icon">R.drawable.qubic_icon</integer>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM