我正在尝试通过mainActivity.cs
在attrs.xml
文件中设置drawable的名称。
attrs.xml文件
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<attr name="logo_name" format="string" />
</resources>
Style.xml
<item name="logo_name">"@drawable/icon_volvo"</item>
在MainActivity.cs
中namespace Decisiv.Droid
{
[Activity(Theme = "@style/Theme.Splash", Icon = "?logo_name", MainLauncher = true, ScreenOrientation = ScreenOrientation.Portrait, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation, NoHistory = true)]
public class SplashActivity : Activity
{
当我使用硬编码字符串时,它可以工作,但不是这样。任何帮助?