여기 Alertdialog
에 긍정적 인 버튼의 색상을 변경하려면, 그리고 내가 아래에 뭘하는지입니다 스타일 :
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity(), R.style.AlertDialogCustom);
내가하고있는 중이 야, 난 그냥 긍정적 인 버튼 색상을 변경하고 싶지 않아. Java 코드에서 버튼의 색상을 변경하고 싶지 않습니다. :-) 사전에
감사
편집-1 에 AlertDialog 레이아웃 XML
<android.support.v7.internal.widget.ButtonBarLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/buttonPanel"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layoutDirection="locale"
android:orientation="horizontal"
android:paddingLeft="12dp"
android:paddingRight="12dp"
android:paddingTop="4dp"
android:paddingBottom="4dp"
android:gravity="bottom"
app:allowStacking="@bool/abc_allow_stacked_button_bar"
style="?attr/buttonBarStyle">
<Button
android:id="@android:id/button3"
style="?attr/buttonBarNeutralButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<android.support.v4.widget.Space
android:id="@+id/spacer"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_weight="1"
android:visibility="invisible" />
<Button
android:id="@android:id/button2"
style="?attr/buttonBarNegativeButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<Button
android:id="@android:id/button1"
style="?attr/buttonBarPositiveButtonStyle"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
질문에 대한 대답이 아닙니까? - http://stackoverflow.com/a/31514677/632516? – Divers
@Divers 아니, 난 이렇게 할 수 없어. 'colorAccent'는 음수와 양수 모두를 바꿀거야 –
하나의 버튼 만 바꾸려면, 해킹하는 해결책이고 디자인 주체를 따르지 않기 때문에 자바를 통해해야한다. android의 어떻게 자바를 통해 그것을 할 - 위의 내 링크를 확인하십시오. – Divers