本来LCD应该是800*600的,但总是得到600*600的结果。
经过好几天的努力,才解决:
<http://schemas.android.com/apk/res/android>"
package="myb.x2.app2"
android:versionCode="1"
android:versionName="1.0">
<android:screenOrientation="portrait"
android:label="@string/app_name">
<android:normalScreens="true"
android:smallScreens="true"
android:anyDensity="true" />
后面加的就可以解决这个问题了,不难理解,但找到这个问题的解决办法却花了我好长时间。
Activity中的代码:
public class myactivity extends Activity {
public myview v;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// setContentView(R.layout.main );
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
// 获得屏幕宽和高
WindowManager windowManager = getWindowManager();
Display display = windowManager.getDefaultDisplay();
int w = display.getWidth();
int h = display.getHeight();
v=new myview(this,w,h);
setContentView(v);
v.start();
}
}