Code example for RelativeLayout.LayoutParams

Methods: setMargins

0
	} 
 
	protected void setHeaderTitle(String title) {
		titleButton.setBackgroundDrawable(new BitmapDrawable());
		titleButton.setText(title);
		LayoutParams lp = new LayoutParams(
				android.view.ViewGroup.LayoutParams.WRAP_CONTENT,
				android.view.ViewGroup.LayoutParams.WRAP_CONTENT);
		lp.setMargins(3, 12, 0, 0);
		titleButton.setLayoutParams(lp);
		// 中文粗体 
		TextPaint tp = titleButton.getPaint();
		tp.setFakeBoldText(true);
	} 
 
	protected void setHeaderTitle(int resource) {
		titleButton.setBackgroundResource(resource);
	} 
 
	protected void initHeader(int style) {
Connect your IDE to all the code out there  Get Codota for Java