本來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();
}
}