Eclipse'de Jelly Bean'i hedef alan yeni bir uygulama oluşturdum. Bu otomatik olarak oluşturulmuş koddur. tezahür setleri AppName uygulama tema: Değerler dir stilleri için AppBaseTheme çevirirAndroid Dialog teması çok hafif simge yapıyor
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
. . .
:
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<!--
Base application theme, dependent on API level. This theme is replaced
by AppBaseTheme from res/values-vXX/styles.xml on newer devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Light">
<!--
Theme customizations available in newer API levels can go in
res/values-vXX/styles.xml, while customizations related to
backward-compatibility can go here.
-->
</style>
<!-- Application theme. -->
<style name="AppTheme" parent="AppBaseTheme">
<!-- All customizations that are NOT specific to a particular API-level can go here. -->
</style>
</resources>
Ve değerlere V14/styles.xml geçerli:
<resources>
<!--
Base application theme for API 14+. This theme completely replaces
AppBaseTheme from BOTH res/values/styles.xml and
res/values-v11/styles.xml on API 14+ devices.
-->
<style name="AppBaseTheme" parent="android:Theme.Holo.Light.DarkActionBar">
<!-- API 14 theme customizations can go here. -->
</style>
</resources>
Daha sonra, çıkmadan önce bir onay iletişim kutusu oluşturdum:
case R.id.menu_quit:
new AlertDialog.Builder(this)
.setIcon(android.R.drawable.ic_dialog_alert)
.setTitle(R.string.confirm_title)
.setMessage(R.string.confirm_text)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
finish();
}
Ve çıkan diyalog kutusudur:
Neden ic_dialog_icon çok hafif? Bu zorlukla görülebilir. Tüm varsayılanları kullanıyorum, temayı veya herhangi bir rengi değiştirmedim, Sistem arka planına daha fazla kontrastlı bir simge seçmesin mi? Bunu nasıl düzeltebilirim? Tomik bilgi takiben düzeltme
ile
Düzenleme ben android.R.attr.alertDialogIcon belgelerine okuyup
new AlertDialog.Builder(this)
.setIconAttribute(android.R.attr.alertDialogIcon)
.setTitle(R.string.confirm_title)
.setMessage(R.string.confirm_text)
.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener() {
(setIconAttribute() ile değiştirilmesi setIcon()) Bu düzeltmeyi yaptı Şimdi diyalog şöyle görünür:
Ben bilgi okumak ve kodunu çözmek. Soruyu yansıtacak şekilde kısa bir süre sonra güncelleyeceğim. ::: BTW Simgelerin her zaman aynı görünmeleri, sadece görünür olmaları gerektiği konusunda endişelenmiyorum. – ilomambo
Bilgi diyaloğu nedir? benzer '.setIconAttribute (android.R.attr. ????) var mı ' ' '.setIcon (android.R.drawable.ic_dialog_info) yerine kullanılacak – JFar