-1
我有一个alertdialog,我使用alertdialog的标题和消息以及按钮的字体。 问题是标题和消息视图的字体,但按钮不是? 为什么 这是我的代码将字体设置为alertdialog
public boolean functionInQuestion(MissingParameters ... parameters) {
Typeface myTypeFace = Typeface.createFromAsset(getAssets(),"fonts/hhh.ttf");
TextView mysite = new TextView(mainn.this);
TextView fbpage = new TextView(mainn.this);
TextView content5 = new TextView(mainn.this);
TextView Mytitle5 = new TextView(mainn.this);
mysite.setText("google");
fbpage.setText("fb");
Mytitle5.setText("google and facebook");
content5.setText("linka to google and facebook");
mysite.setTypeface(myTypeFace);
fbpage.setTypeface(myTypeFace);
content5.setTypeface(myTypeFace);
Mytitle5.setTypeface(myTypeFace);
AlertDialog.Builder builder = new AlertDialog.Builder(mainn.this);
builder.setView(content5);
builder.setCustomTitle(Mytitle5);
builder.setIcon(R.drawable.about);
builder.setPositiveButton(fbpage.getText(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// When LeftButton click, source implementing is put here.
String url = "http://www.facebook.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
builder.setNeutralButton(mysite.getText(), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
// When CenterButton click, source implementing is put here.
String url = "http://www.google.com";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
builder.show();
return false;
}
它现在的工作!我的设备 – user5050715
请接受答案.. –
抱歉,但我说没有工作...但它写入错误....它不工作锦波 – user5050715