这是界面代码
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<ImageView
android:src="@drawable/home"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/imageView">
</ImageView>
</LinearLayout>
这是我activity界面代码
//全屏代码
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,WindowManager.LayoutParams. FLAG_FULLSCREEN);
setContentView(R.layout.home);
但是显示出来图片在中间上下都是黑色的。没拉伸。不知道什么问题啊。都帮忙看下啊
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<ImageView
android:src="@drawable/home"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/imageView">
</ImageView>
</LinearLayout>
这是我activity界面代码
//全屏代码
requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams. FLAG_FULLSCREEN ,WindowManager.LayoutParams. FLAG_FULLSCREEN);
setContentView(R.layout.home);
但是显示出来图片在中间上下都是黑色的。没拉伸。不知道什么问题啊。都帮忙看下啊
解决方案 »
- 自己开发了一款手机控制电脑的软件,诚邀大家捧捧场呀!MobCtrl万能遥控
- 怎样加载sdcard上的so库
- 关于Matrix的函数问题
- 必须在activity中操作文件夹吗?
- 初涉android,进来看看我这模拟器对不??
- pppd: This system lacks kernel support for PPP
- 关于Handler机制的使用
- JSON的解析问题
- 安桌链接SQLSERVER利用.NET做webservice
- 自定义view onDraw遇到的奇葩问题,有没有谁遇到过?
- findPreference("individual_name").setEnabled(!findPreference("individual_name").
- 界面美化相关的一个问题
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/home"
xmlns:android="http://schemas.android.com/apk/res/android"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
>
<ImageView
android:src="@drawable/home"
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:id="@+id/imageView">
</ImageView>
</LinearLayout>
红色是修改的部分,这样就行了
Bitmap bitmap = BitmapFactory.decodeResource(getResources(), R.drawable.home);
BitmapDrawable bd = new BitmapDrawable(bitmap);
bd.setTileModeXY(TileMode.CLAMP , TileMode.CLAMP );
bd.setDither(true);
imageView.setBackgroundDrawable(bd);
我直接画上去是可以的。不过图片有些小失真