例子:
package com.AndroidDualLineButton;
import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.widget.Button;
public class AndroidDualLineButton extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Button myButton = (Button)findViewById(R.id.mybutton);
myButton.setText(Html.fromHtml("<b>" + "Line One" + "</b>" + "<br />" + "<small>" + "Line Two" + "</small>"));
}
}
此留言已被作者移除。
回覆刪除有語法錯誤說= =
回覆刪除是不是br他把他換行了