
是否可以在单选按钮内添加文本提示,而不是在单选按钮旁边添加常规文本?在gui生成器上使用提示设置不起作用。
发布于 2017-01-24 15:10:07
这就是我发现的有效的解决方案。
if (Build.VERSION.SDK_INT<24) {
radio_button.setText(Html.fromHtml("<b><font color='"+ Color.BLACK+"'>"+getString(R.string.title)+ "</font></b>" + "<br />" +
"<small> <font color='"+Color.GRAY+"'>" + getString(R.string.description)+"</font></small>" + "<br />"
));
}else
{
radio_button.setText(Html.fromHtml("<b><font color='"+ Color.BLACK+"'>"+getString(R.string.title)+ "</font></b>" + "<br />" +
"<small> <font color='"+Color.GRAY+"'>" + getString(R.string.description)+"</font></small>" + "<br />"
),Html.FROM_HTML_MODE_LEGACY);
}https://stackoverflow.com/questions/35210086
复制相似问题