Próbuję zmienić kolor tekstu i czcionkę tytułu "Wprowadź szczegóły", które można zobaczyć w poniższej migawce, ale nie udało się jej wykonać. Pomóż mi rozwiązać ten problem.Jak skonfigurować tytuł komunikatu alarmowego
Code: -
public class MainActivity extends Activity {
Button cust;
Dialog custom;
EditText Fname;
EditText Lname;
TextView txt;
Button savebtn;
Button canbtn;
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
cust = (Button)findViewById(R.id.cusdia);
txt = (TextView)findViewById(R.id.txt);
cust.setOnClickListener(new View.OnClickListener()
{
String fname,lname;
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
custom = new Dialog(MainActivity.this);
custom.setContentView(R.layout.dialog);
Fname = (EditText)custom.findViewById(R.id.fname);
Lname = (EditText)custom.findViewById(R.id.lname);
savebtn = (Button)custom.findViewById(R.id.savebtn);
canbtn = (Button)custom.findViewById(R.id.canbtn);
custom.setTitle("Enter Details");
savebtn.setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View view) {
// TODO Auto-generated method stub
fname = Fname.getText().toString();
lname = Lname.getText().toString();
txt.setText("Your Name is "+fname +lname);
custom.dismiss();
}
});
alert okno dialogowe Snapshot
trzeba zrobić własny arkusz stylów dla tego lub jeśli nie jest wielkość czcionki lub kolor tekstu dostępna wtedy można go zmienić w pliku xml – Umair