您可以:
答:将您的图像一分为二
。将顶部作为ActionBar徽标,然后在内容上方显示底部。
B.使用单个图像
您将需要一个仅包含徽标的布局文件(您可能想要一个诸如
ImageViewa的东西,
LinearLayout以便可以轻松设置正确的边距)。然后,在调用
setContentView您的活动之后,添加带有以下内容的徽标视图:
ViewGroup decorViewGroup = (ViewGroup) getWindow().getDecorView();decorViewGroup.addView(logoView);
使用布局文件
布局文件示例(logo_view.xml):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/logo_image" android:scaleType="center" android:layout_marginLeft="10dip" /></LinearLayout>
膨胀布局文件:
LayoutInflater inflater = LayoutInflater.from(this);View logoView = inflater.inflate(R.layout.logo_view, null, false);



