탭위젯의 tab 안의 공백을 어떻게 줄이거나 없앨수 있을까요?(그림참조)
---------------------------------+++
public class TabDemo extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
TabHost tabs=(TabHost)findViewById(R.id.tabhost);
tabs.setup();
TabHost.TabSpec spec=tabs.newTabSpec("tag1");
spec.setContent(R.id.tab1);
spec.setIndicator("시계");
tabs.addTab(spec);
spec=tabs.newTabSpec("tag2");
spec.setContent(R.id.tab2);
spec.setIndicator("버튼");
tabs.addTab(spec);
spec=tabs.newTabSpec("tag3");
spec.setContent(R.id.tab3);
spec.setIndicator("Start");
tabs.addTab(spec);
this.setupButton();
}
private void setupButton()
{
Button b = (Button)this.findViewById(R.id.startFAButtonId);
b.setOnClickListener(
new Button.OnClickListener() {
public void onClick(View v)
{
parentButtonClicked(v);
}
});
}
private void parentButtonClicked(View v)
{
animate();
}
private void animate()
{
ImageView imgView = (ImageView)findViewById(R.id.imageView);
imgView.setVisibility(ImageView.VISIBLE);
imgView.setBackgroundResource(R.drawable.frame_animation);
AnimationDrawable frameAnimation =
(AnimationDrawable) imgView.getBackground();
if (frameAnimation.isRunning())
{ frameAnimation.stop(); }
else
{
frameAnimation.stop();
frameAnimation.start();
}
}
}
제가 사용하는 코드입니다.
for (int i = 0; i <2; ++i){
tabHost.getTabWidget().getChildAt(i).getLayoutParams().height = 50;
}