![](/img/trans.png)
[英]Best layout design for this application(tab bar with screen transition)?
[英]Best Layout Design of Bottom Tab Bar in HoneyComb Tablet App
我想在HoneyComb Tablet的底部设计Tab Bar。 那么,是否有任何特定的方法或栏可用于设计底部标签栏的布局?
只需在Android中使用默认的TabHosts并添加属性
android:layout_alignParentBottom="true"
请参阅下面的链接以获取更多信息
绘制iPhone类型的标签栏
我通常在LinearLayout Horizontal中将TextView与背景辅助对象一起使用。
TextView具有可绘制的top属性,可以帮助包含图标。
我不建议使用默认的标签布局
public void setFooterStyle(Context c,TextView profile,TextView parking,TextView taxi,TextView history,TextView help,int flag)
{
if(flag==0)
{
profile.setBackgroundResource(R.drawable.grey_background_gradient);
profile.setTextColor(Color.rgb(255, 255, 255));
profile.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.profile1, 0, 0);
}
else if(flag==1)
{
parking.setBackgroundResource(R.drawable.grey_background_gradient);
parking.setTextColor(Color.rgb(255, 255, 255));
}
else if(flag==2)
{
taxi.setBackgroundResource(R.drawable.grey_background_gradient);
taxi.setTextColor(Color.rgb(255, 255, 255));
taxi.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.taxi_on, 0, 0);
}
else if(flag==3)
{
history.setBackgroundResource(R.drawable.grey_background_gradient);
history.setTextColor(Color.rgb(255, 255, 255));
history.setCompoundDrawablesWithIntrinsicBounds(0, R.drawable.history_on, 0, 0);
}
在您的活动中
Global.getInstance().setFooterStyle(getApplicationContext(),(TextView) findViewById(R.id.btnprofile),(TextView)findViewById(R.id.btnparking),(TextView)findViewById(R.id.btntaxi),(TextView) findViewById(R.id.btnhistory),(TextView) findViewById(R.id.btnhelp), 4);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.