2012-01-19 12 views
0

Im这个新的Android开发,并且即时通讯正在播放跟随Mono for Android安装的HelloM4A项目。设置主题Holo.Light在单声道为Android

我也注意到Google希望我们使用他们的设计gudide,并且我找到了他们使用的指南中的一个主题。它被称为Holo Light

现在,我该如何将该主题追加到我的项目中?我是否需要下载主题,或者在手机上是否标准?

我试过这个代码(下面),但它确实抛出了一个构建错误,很奇怪,因为我没有在我的Error list中发现错误。

[Activity(Label = "HelloM4A", MainLauncher = true, Icon = "@drawable/icon", Theme = "@style/Theme.Holo.Light")] 
public class Activity1 : Activity 
{ 
    int count = 1; 

    protected override void OnCreate(Bundle bundle) 
    { 
     base.OnCreate(bundle); 

     // Set our view from the "main" layout resource 
     SetContentView(Resource.Layout.Main); 

     // Get our button from the layout resource, 
     // and attach an event to it 
     Button button = FindViewById<Button>(Resource.Id.MyButton); 

     button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); }; 
    } 
} 

这是我的项目布局:

enter image description here

任何帮助表示赞赏!

回答

2

在u项目中有一些名称清单文件。 你必须给主题得到活动下面shon。

<activity 
     android:name="com.aviz.pep.android.ui.classname" 
     android:theme="@android:style/Theme.Translucent.NoTitleBar" > 
    </activity> 

代替theme.transulent.notilebar 添加您的主题名称,但要确保你使用的是最新的SDK

+0

谢谢,但你从我的项目布局看(我的文章),我没有清单文件。我应该创建它吗?它应该在哪里?记住即时通讯使用Visual Studio和Mono for Android。 – Martin

+0

该链接可能有帮助ü – aviz

+0

http://msdn.microsoft.com/en-us/library/ms235229(v=vs.80).aspx – aviz