我刚刚在Window 7 64bit中安装了Android Studio.
当我启动应用程序时,我们编写代码的屏幕背景为白色.
我更喜欢黑色或任何其他颜色.
我不确定我们是否可以更改颜色/主题或添加更多主题.
Visual Studio 2012提供了两个主题,Light和Dark.我想将主题切换为黑暗,但我无法找到任何菜单或选项来做到这一点.
我发现了一种导入设置的方法:
Microsoft Visual Studio 11.0\Common7\IDE\ FontsAndColorsThemes\1ded0138-47ce-435e-84ef-9ec1f439b749.vssettings
Run Code Online (Sandbox Code Playgroud)
并且代码编辑器现在处于Dark主题中,但其他窗口仍处于Light主题中,例如Solution Explorer,Toolbox和Toolbars.
我应该怎么做才能切换主题?
我想知道是否有人可以帮助我.我正在尝试创建自定义AlertDialog.为此,我在styles.xml中添加了以下代码行
<resources>
<style name="CustomAlertDialog" parent="android:Theme.Dialog.Alert">
<item name="android:windowBackground">@drawable/color_panel_background</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
以下是主要活动.
package com.customdialog;
import android.app.Activity;
import android.app.AlertDialog;
import android.app.Dialog;
import android.content.DialogInterface;
import android.os.Bundle;
public class CustomDialog extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
this.setTheme(R.style.CustomAlertDialog);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setMessage("HELLO!");
builder .setCancelable(false)
.setPositiveButton("Yes", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int id) {
//MyActivity.this.finish();
}
})
.setNegativeButton("No", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int …
Run Code Online (Sandbox Code Playgroud) 有谁知道如何在Notepad ++中更改背景颜色,字体大小和其他基于外观的设置?默认为白色,但我试图将其更改为深灰色或其他内容.
我一直在试图弄清楚如何组织我的ResourceDictionary文件以便重用并与我团队的其他成员共享.
我一直遇到"Generic.xaml",但如果我在MSDN上查看Generic.xaml或者只是进行谷歌搜索,我似乎只会发现博客文章和论坛问题 - 我似乎无法打击任何真正权威和清晰的东西.
Generic.xaml和MyRandomlyNamedResourceDictionary.xaml有什么区别?看起来无论哪种方式,我都必须使用Source属性引用存储在库中的ResourceDictionaries.例如,:
<Application.Resources>
<ResourceDictionary
Source="/CommonLibraryWpfThemes;component/Themes/Generic.xaml"
</Application.Resources>
Run Code Online (Sandbox Code Playgroud)
那么Generic.xaml有什么优势呢?如果我不试图给我的应用程序多个"外观"(即,如果我只有一个主题),它是否有任何目的?
我创建了一个PreferenceActivity,允许用户选择他想要应用于整个应用程序的主题.
当用户选择主题时,执行以下代码:
if (...) {
getApplication().setTheme(R.style.BlackTheme);
} else {
getApplication().setTheme(R.style.LightTheme);
}
Run Code Online (Sandbox Code Playgroud)
但是,即使我已经使用调试器检查了代码是否正在执行,我也看不到用户界面的任何变化.
主题是定义的res/values/styles.xml
,Eclipse没有显示任何错误.
<resources>
<style name="LightTheme" parent="@android:style/Theme.Light">
</style>
<style name="BlackTheme" parent="@android:style/Theme.Black">
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
关于可能发生的事情以及如何解决问题的任何想法?我应该拨打setTheme
代码中的任何特殊点吗?如果有帮助,我的应用程序包含几个活动.
我知道Eclipse中有一个选项可以"恢复默认值".
问题是我导入了一个.epf来改变我的编辑器字体/颜色.
我不是变化的忠实粉丝,我想回去.我已经尝试删除eclipse文件夹并下载一个新的副本,但样式仍然存在.
我假设有一个我可以删除的配置文件.
无论如何,如果你能帮助我,我会很感激.我已经找到了解决方案,但它们似乎都指向了对我不起作用的相同答案.
我喜欢黑暗的主题.但是,Jupyter笔记本的默认主题很轻,我找不到更改主题/背景颜色的选项.这是怎么做到的?