我在Android应用程序中工作,我在我的应用程序中使用android复选框。当我在活动中使用复选框时,它非常明显且偏黑。但是当我在“自定义”对话框中使用相同的复选框时,该复选框变得非常精简。我想让对话框中的复选框更加偏黑,就像出现在自定义复选框中的活动一样。请建议我一个合适的解决方案。
private void showIndividualDeleteDialog(List<CommonDomain> individuals) {
try {
final Dialog dialog = new Dialog(SessionActivity.this);
dialog.requestWindowFeature(Window.FEATURE_NO_TITLE);
dialog.setContentView(R.layout.individualssession);
final IndividualAdaptor adaptor = new IndividualAdaptor(
individuals, getApplicationContext());
((ListView) dialog.findViewById(R.id.individualsListView))
.setAdapter(adaptor);
dialog.show();
((ImageButton) dialog.findViewById(R.id.individualDeleteButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
List<CommonDomain> selectedUser = adaptor.mLstClientInGroup;
String xml = makeRemoveIndividualsXml(selectedUser);
new StopSessionAsynk(dialog)
.execute(new String[] { xml });
}
});
((Button) dialog.findViewById(R.id.individualCancelButton))
.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
XML
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/back_button_gradient"
android:paddingTop="1dp" >
<Button
android:id="@+id/individualCancelButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:layout_marginLeft="5dp"
android:onClick="onCancelButton_Click"
android:text="Cancel" />
<ImageButton
android:id="@+id/individualDeleteButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:background="@drawable/delete_btn_selector"
android:onClick="onDeleteButton_Click" />
</RelativeLayout>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#151515"
android:gravity="center"
android:text="@string/individuals_delete_HeadText"
android:textColor="@android:color/white"
android:textSize="18sp" />
<ListView
android:id="@+id/individualsListView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:divider="#D5D5D5"
android:background="@android:color/white"
android:dividerHeight="1dp" >
</ListView>
</LinearLayout>
ListView行xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@android:color/white"
android:descendantFocusability="blocksDescendants"
android:minHeight="44dp"
android:padding="3dp" >
<TextView
android:id="@+id/individualNameTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/individualsCheckBox"
android:paddingLeft="2dp"
android:textColor="@android:color/black"
android:textStyle="bold" >
</TextView>
<CheckBox
android:id="@+id/individualsCheckBox"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:clickable="false" />
</RelativeLayout>