Skip to content

Instantly share code, notes, and snippets.

@emoralest
Created April 14, 2015 19:57
Show Gist options
  • Save emoralest/e773335f8bf657d72f65 to your computer and use it in GitHub Desktop.
Save emoralest/e773335f8bf657d72f65 to your computer and use it in GitHub Desktop.
Android - Ocultar Divider de un Dialog
final Dialog dialog = new Dialog(getActivity());
dialog.setContentView(R.layout.dialog_regemail);
dialog.getWindow().setBackgroundDrawableResource(android.R.color.transparent);
//HACK PARA ELIMINAR DIVIDER DE UN DIALOG
int dividerId = dialog.getContext().getResources().getIdentifier("android:id/titleDivider", null, null);
View divider = dialog.findViewById(dividerId);
divider.setBackgroundColor(getResources().getColor(android.R.color.transparent));
//CONTROLES DENTRO DEL DIALOG
Button btnRegistrar = (Button) dialog.findViewById(R.id.btnRegistrar);
//LISTENER DE BOTÓN DEL DIALOG
btnRegistrar.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment