Мне нужно центрировать заголовок AlertDialog в Android Studio, я пробовал несколько форм, но безуспешно, кто-нибудь может сказать мне, возможно ли это и как это сделать?
Вот мой код
public class ExampleDialog extends AppCompatDialogFragment {
private EditText myIpAddress;
private EditText myIpPort;
private ExampleDialogListener listener;
@Override
public Dialog onCreateDialog(Bundle savedInstanceState) {
AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
LayoutInflater inflater = getActivity().getLayoutInflater();
View view = inflater.inflate(R.layout.layout_dialog, null);
builder.setView(view)
.setTitle("Configuracion WIFI")
.setMessage("Ingrese la IP y el Puerto del Relay Remoto ")
.setNegativeButton("Cancelar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
}
})
.setPositiveButton("Aceptar", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
String username = myIpAddress.getText().toString();
String password = myIpPort.getText().toString();
listener.applyTexts(username, password);
}
});
myIpAddress = view.findViewById(R.id.etx_ipAddress);
myIpPort = view.findViewById(R.id.etx_ipPort);
return builder.create();
}