我正在尝试从默认的android迁移AlertDialog到appCompat-22.1中包含的新的android 到目前为止我了解你只需导入android.support.v7.app.AlertDialog包以便使用它.
但我怎么样呢呢?例如,更改正/负按钮颜色,标题颜色,消息颜色和背景颜色?
android android-appcompat android-alertdialog android-support-library
如果我添加一个EditTextXML,我可以设置textCursorDrawable="@null":
<EditText
android:id="@+id/txtE3Casecode4"
android:layout_width="30dp"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="#C7C7C5"
android:textCursorDrawable="@null"
android:ems="10"
android:inputType="number"
android:maxLength="2"
android:text="01"
android:textColor="#000000" />
Run Code Online (Sandbox Code Playgroud)
现在我画一个EditTextJava.我想要设定android:textCursorDrawable="@null".
LinearLayout.LayoutParams paramtext = new LinearLayout.LayoutParams(
LinearLayout.LayoutParams.FILL_PARENT,
LinearLayout.LayoutParams.WRAP_CONTENT);
EditText txtOther = new EditText(this);
txtOther.setLayoutParams(paramtext);
txtOther.setBackgroundColor(Color.WHITE);
txtOther.setTextColor(Color.BLACK);
txtOther.setId(99999);
// txtOther.setCursorDrawable ?
Run Code Online (Sandbox Code Playgroud)
怎么设置它?
我已经尝试了一切来使这个工作,但无法搞清楚.
我试图在我的应用程序中使用警报对话框.它适用于KitKat,但不适用于Lollipop.
我甚至尝试在GitHub上使用许多材料对话框,然后他们再次在Kitkat上工作,但在Lollipop上却没有.
我正在使用库存nexus工厂映像测试我的Nexus 5.
KITKAT与GITHUB材料对话
KITKAT与股票警报对话
LOLLIPOP与GITHUB材料对话
LOLLIPOP与股票警报对话
这也就是github上安装在同一设备上的库,它不能正常工作.所以关于我的应用程序的东西导致了这一点.会是什么呢
我正在为我的应用程序使用appcompat v21.0.3.我做了像这里写的所有内容:android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html
但是在Lollipop(当然还有旧设备上),一些小部件并没有用我的强调色调着色.例如:
SwitchCompat着色: 
ListPreference没有着色 
ProgressDialog没有着色 
这是我的代码:
的build.gradle
...
compile 'com.android.support:appcompat-v7:21.0.+'
...
Run Code Online (Sandbox Code Playgroud)
AndroidManifest.xml中
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/CET"
android:hardwareAccelerated="true"
tools:replace="label">
Run Code Online (Sandbox Code Playgroud)
的themes.xml
<resources>
<style name="CET" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
</style>
</resources>
Run Code Online (Sandbox Code Playgroud)
colors.xml
<resources>
<!-- App branding color -->
<color name="primary">#a32b30</color>
<!-- Darker variant for status bar and contextual app bars -->
<color name="primary_dark">#000000</color>
<!-- Theme UI constrols like checkboxes and text fields -->
<color name="accent">#a32b30</color>
</resources>
Run Code Online (Sandbox Code Playgroud)
有人有想法吗?
更新:截至2015年6月,仍然无法正常工作,但我最终使用https://github.com/afollestad/material-dialogs.对包括ListPreferences在内的对话框非常有用.
android android-appcompat android-widget android-5.0-lollipop
我开始将我的应用程序移植到棒棒糖中.我能够将整个应用程序设为我喜欢的特定颜色,但我无法改变始终为绿色的ProgressDialog的颜色.有没有办法做到这一点?
android ×5