<!DOCTYPE html>
<html>
<head>
<!-- locally referred ExtJS library files -->
<link href="ExtjsLib/ext-all.css" rel="stylesheet"
<script type="text/javascript" src="ExtjsLib/ext-all.js"></script>
<script type="text/javascript" src="ExtjsLib/ext-base.js"></script>
<script type="text/javascript"> Ext.BLANK_IMAGE_URL = "ExtjsLib/s.gif"; </script>
<script type="text/javascript">
Ext.onReady(function() {
Ext.create('Ext.Panel', {
renderTo: 'helloWorldPanel',
height: 200,
width: 600,
title: 'Hello world',
html: 'First Ext JS Hello World Program'
});
});
</script>
</head>
<body>
<div id="helloWorldPanel" />
</body>
</html>
我的代码出了什么问题。我正在使用ExtJS 3.4.1版本,并且我已经从ExtLib&#39;本地引用了Extjs库文件。夹。它只显示空白页面作为输出。请帮忙。
答案 0 :(得分:1)
这一行:
public class AccelerometerActivity extends Activity implements SensorEventListener {
private SensorManager sensorManager;
private Sensor accelerometer;
private long lastUpdate;
Bitmap mBitmap1;
// AnimatedView animatedView = null;
//ShapeDrawable mDrawable = new ShapeDrawable();
public static int x;
public static int y;
private ImageView imageView;
private int bitmapWidth, screenWidth,screenHeight,bitmapHeight;
int maxxLeft, maxxRight, scrollByX, totalX,totalY,maxTop,maxBottom,scrollByY;
URL url;
String filepath = null;
ProgressDialog progressDialog;
int b;
//ProgressDialog pd;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_accelerometer);
imageView = (ImageView) findViewById(R.id.imageView1);
progressDialog = new ProgressDialog(AccelerometerActivity.this);
progressDialog.setMessage("loading");
Display display = getWindowManager().getDefaultDisplay();
Point size = new Point();
display.getSize(size);
screenWidth = size.x;
screenHeight=size.y;
sensorManager = (SensorManager) getSystemService(SENSOR_SERVICE);
accelerometer = sensorManager
.getDefaultSensor(Sensor.TYPE_ACCELEROMETER);
lastUpdate = System.currentTimeMillis();
Resources res = getResources();
Bitmap mBitmap = BitmapFactory.decodeResource(res, R.drawable.panaromic1);
BitmapDrawable bDrawable = new BitmapDrawable(res, mBitmap);
imageView.setImageBitmap(mBitmap);
//get the size of the image and the screen
bitmapWidth = bDrawable.getIntrinsicWidth();
//int bw=mBitmap1.getWidth();
bitmapHeight = bDrawable.getIntrinsicHeight();
Log.v("sw",screenWidth+"");
Log.v("bw",bitmapWidth+"");
//Log.v("sw",screenHeight+"");
//Log.v("bw",bitmapHeight+"");
int maxX = (int) ((bitmapWidth / 2) - (screenWidth / 2));
// int maxY = (int) ((bitmapHeight / 2) - (screenHeight / 2));
maxxLeft = (maxX * -1);
maxxRight = maxX;
// maxTop = (maxY * -1);
//maxBottom = maxY;
}
@Override
protected void onResume() {
super.onResume();
sensorManager.registerListener(this, accelerometer,
SensorManager.SENSOR_DELAY_GAME);
}
@Override
protected void onPause() {
super.onPause();
sensorManager.unregisterListener(this);
}
@Override
public void onAccuracyChanged(Sensor arg0, int arg1) {
// TODO Auto-generated method stub
}
@Override
public void onSensorChanged(SensorEvent event) {
// TODO Auto-generated method stub
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER) {
//x -= (int) event.values[0];
//y += (int) event.values[1];
x = (int) event.values[0];
y = (int) event.values[1];
scrollByX = x;
scrollByY = y;
if (x > 0) {
if (totalX == maxxRight) {
scrollByX = 0;
}
if (totalX < maxxRight) {
totalX = totalX + scrollByX;
}
if (totalX > maxxRight) {
scrollByX = maxxRight - (totalX - scrollByX);
totalX = maxxRight;
}
/*String xx="";
Log.v("xx:",xx+scrollByX);*/
imageView.scrollBy(scrollByX, 0);
/*imageView.scrollBy(5 ,0);*/
} else {
if (totalX == maxxLeft) {
scrollByX = 0;
}
if (totalX > maxxLeft) {
totalX = totalX + scrollByX;
}
if (totalX < maxxLeft) {
scrollByX = maxxLeft - (totalX - scrollByX);
totalX = maxxLeft;
}
imageView.scrollBy(scrollByX, 0);
}
}
}
public class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
ImageView bmImage;
public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;
}
@Override
protected void onPreExecute() {
// TODO Auto-generated method stub
super.onPreExecute();
progressDialog.show();
//pd.show();
}
protected Bitmap doInBackground(String... urls) {
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(urldisplay).openStream();
mBitmap1 = BitmapFactory.decodeStream(in);
//b=mBitmap1.getWidth();
} catch (Exception e) {
Log.e("Error", e.getMessage());
e.printStackTrace();
}
return mBitmap1;
}
@Override
protected void onPostExecute(Bitmap result) {
super.onPostExecute(result);
//pd.dismiss();
progressDialog.dismiss();
}
}
}
应该是这个
HttpPostedFileBase file = Request.Files["vendorsEditUploadCertBlockName" + cr];
if (file.ContentLength > 0) {
var fileName = Path.GetFileName(file.FileName);
file.SaveAs("~/App_Data/uploads/certifications/" + insertCert.CERTIFICATION_ID + "/" + fileName);
}
如果你不关闭评论,一切都是评论。
答案 1 :(得分:0)
使用Library Ext.all.debug.js而不是ext.base.js。