android连连看游戏中,怎么样把飘动的小图片删除,下面有部分代码,我也不清楚是不是这段代码
publicclassWelcomeActivityextendsActivity{privateButtonstartBtn;privateButtonexitBtn;...
public class WelcomeActivity extends Activity{
private Button startBtn;
private Button exitBtn;
private Button aboutBtn;
private Button setBtn;
private Button blueToothBtn;
private TextView logo;
private NotificationManager nMgr;
private boolean music = false;
private RefreshHandler mRedrawHandler;
private int[] count = {0,0,0,0,0};
private int[] sizes = {10,10,10,10,10};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去除程序的标题栏
super.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
//去除系统消息提示栏,游戏全屏
super.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.begin);
logo = (TextView)findViewById(R.id.logo);
AnimationSet animation = (AnimationSet) AnimationUtils.loadAnimation(getApplicationContext(), R.anim.welcome);
Interpolator i = new AccelerateDecelerateInterpolator();
animation.setInterpolator(i);
logo.startAnimation(animation);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {}
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) {
setContentView(R.layout.in);
startBtn = (Button) findViewById(R.id.startBtn);
exitBtn = (Button) findViewById(R.id.exitBtn);
setBtn = (Button) findViewById(R.id.setBtn);
aboutBtn = (Button) findViewById(R.id.aboutBtn);
blueToothBtn = (Button) findViewById(R.id.blueToothBtn);
mRedrawHandler = new RefreshHandler();
mRedrawHandler.sleep(50);
/**
* 点击开始按钮,跳转到游戏主界面
*/
startBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startBtn.setBackgroundResource(R.drawable.color_bkg_3);
Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putBoolean("music", music);
intent.putExtras(bundle);
intent.setClass(WelcomeActivity.this,LLKanActivity.class);
WelcomeActivity.this.startActivity(intent);
}
});
那个漂浮的小图片是logo.png,等级不够,不能上传图片,希望有高手能指导一下 展开
private Button startBtn;
private Button exitBtn;
private Button aboutBtn;
private Button setBtn;
private Button blueToothBtn;
private TextView logo;
private NotificationManager nMgr;
private boolean music = false;
private RefreshHandler mRedrawHandler;
private int[] count = {0,0,0,0,0};
private int[] sizes = {10,10,10,10,10};
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//去除程序的标题栏
super.requestWindowFeature(Window.FEATURE_NO_TITLE);
super.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
//去除系统消息提示栏,游戏全屏
super.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView(R.layout.begin);
logo = (TextView)findViewById(R.id.logo);
AnimationSet animation = (AnimationSet) AnimationUtils.loadAnimation(getApplicationContext(), R.anim.welcome);
Interpolator i = new AccelerateDecelerateInterpolator();
animation.setInterpolator(i);
logo.startAnimation(animation);
animation.setAnimationListener(new AnimationListener() {
public void onAnimationStart(Animation animation) {}
public void onAnimationRepeat(Animation animation) {}
@Override
public void onAnimationEnd(Animation animation) {
setContentView(R.layout.in);
startBtn = (Button) findViewById(R.id.startBtn);
exitBtn = (Button) findViewById(R.id.exitBtn);
setBtn = (Button) findViewById(R.id.setBtn);
aboutBtn = (Button) findViewById(R.id.aboutBtn);
blueToothBtn = (Button) findViewById(R.id.blueToothBtn);
mRedrawHandler = new RefreshHandler();
mRedrawHandler.sleep(50);
/**
* 点击开始按钮,跳转到游戏主界面
*/
startBtn.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
startBtn.setBackgroundResource(R.drawable.color_bkg_3);
Intent intent = new Intent();
Bundle bundle = new Bundle();
bundle.putBoolean("music", music);
intent.putExtras(bundle);
intent.setClass(WelcomeActivity.this,LLKanActivity.class);
WelcomeActivity.this.startActivity(intent);
}
});
那个漂浮的小图片是logo.png,等级不够,不能上传图片,希望有高手能指导一下 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询