一.什么是屏幕适配
屏幕适配就是根据屏幕的大小,适配不同的尺寸。
二.尺寸适配怎么做
1.创建不同分辨率的values文件夹,在其中分别创建dimens.xml:

2.在values-960x540目录下的dimens.xml里定义诸如下面这些尺寸:

3在Activity中的调用方法为:

三.图片适配怎么做
1.首先将相同的图片放入不同尺寸的dpi文件夹中:

2.然后通过不同分辨率的手机,就能实现了。
四.什么是9.png图片
9png图片一般用在需要拉伸的地方,比如聊天程序的对话框,字数不同,对话框的大小也不同。效果如图:

五.文字国际化(文字适配)怎么做
1.在res中创建一个values-en文件夹
2.新建一个strings-en文件
3.将里面的文字改成英文即可。
如图:

六.横竖屏适配怎么做
1创建一个layout-land文件夹,里面的布局文件要与layout的一样,如图:

layout的代码为:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.androidthree.Main4Activity">
<TextView
android:layout_width="match_parent"
android:layout_height="200dp"
android:text="竖屏视频播放区"
android:textSize="30dp"
android:gravity="center"
android:background="#666"
/>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#999"
>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="简介"
android:gravity="center"/>
<TextView
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="评论"
android:gravity="center"/>
</LinearLayout>
</LinearLayout>
layout-land的代码为:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:context="com.example.androidthree.Main4Activity">
<TextView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:text="竖屏视频播放区"
android:textSize="30dp"
android:gravity="center"
android:background="#666"
/>
</LinearLayout>