| setPadding() | ใช้กำหนด padding ให้กับ Object TextView ทางด้าน ซ้าย บน ขวา และล่าง ตามลำดับ |
|---|
method:setPadding ( int left, int top, int right, int bottom )
return type:void
content:ใช้กำหนด padding ให้กับ Object TextView ทางด้าน ซ้าย บน ขวา และล่าง ตามลำดับ
example:public class AndroidBamboo extends Activity { public void onCreate( Bundle savedInstanceState ) { super.onCreate ( savedInstanceState ); TextView text = new TextView ( this ); text.setText ( "WelCome To BambooLabCode.com" ); text.setPadding ( 5, 10, 5, 10 ); setContentView ( text ); } }