android中插入图片的三种方式
来源:互联网 发布:c语言1到100的素数 编辑:程序博客网 时间:2024/05/29 12:23
1.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/timg"/></RelativeLayout>
2.
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/timg" > <TextView android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="@string/hello_world" /></RelativeLayout>
3.
package com.bin.com;import android.os.Bundle;import android.app.Activity;import android.view.Menu;public class MainActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); getWindow().setBackgroundDrawableResource(R.drawable.timg); } }
3中方法各有优缺点,自己尝试一下,顺便说一下,高清图片不支持的哦
阅读全文
0 0
- android中插入图片的三种方式
- android 加载图片的三种方式
- android图片压缩的三种方式
- Android图片压缩的三种方式
- android图片压缩的三种方式
- android图片压缩的三种方式
- Android中获取圆角图片和圆形图片的三种方式
- CSDN中插入图片方式
- android获得图片资源的三种方式
- android获得图片资源的三种方式
- Android实现加载(loading)图片旋转的三种方式
- Android三种基本的加载网络图片方式
- Android三种基本的加载网络图片方式
- Android三种基本的加载网络图片方式
- Android之---加载图片的三种方式
- Android三种基本的加载网络图片方式
- Android开发之--图片压缩的三种方式
- Android三种基本的加载网络图片方式
- qss界面制作
- 《JavaScript DOM编程艺术》读书笔记
- Visual Studio 2017 + java + C++ and swig
- python(2)--语法
- 利用HBuilder开发基于MUI的H5+ app中使用百度地图定位功能
- android中插入图片的三种方式
- Linux的环境变量
- ios-关于GCD的简单使用
- jQuery选择器
- python网络爬虫-使用BeautifulSoup
- Jetson TX1内核kernel编译与烧写
- Java对一维数组排序:冒泡,选择,插入,比较效率
- React性能优化 PureComponent 使用指南
- c++的动态类