There is a walkthrough on how to do this here
在資源,包括:如果你使用的是
new AlertDialog.Builder(new ContextThemeWrapper(context, R.style.AboutDialog))
或者這樣:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- AlertDialog text color fix thanks to Shawn Castrianni, see: http://groups.google.com/group/android-developers/browse_thread/thread/f0b34621d3a70c4b -->
<style name="AboutDialog" parent="@android:style/Theme.Dialog">
<item name="android:textColor">?android:attr/textColorPrimaryInverseDisableOnly</item>
</style>
</resources>
構建你的對話框,使用此自定義佈局:
View view = View.inflate(new ContextThemeWrapper(context, R.style.AboutDialog), R.layout.about_dialog, null);
你試過嗎? http://blog.andromo.com/2011/fixing-text-colours-on-an-alertdialog-when-using-theme-light/不幸的是,它僅在Honeycomb後才起作用。 – Codeman
哦,它太棒了!無論如何,我希望它可以用於發佈蜂窩,因爲我擁有以前的輕量級主題。發佈它作爲答案我會接受它。謝謝 – Snake
完成,它張貼:) – Codeman