Android欢迎界面

/** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); //取消标题 this.requestWindowFeature(Window.FEATURE_NO_TITLE); //取消状态栏 this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); setContentView(R.layout.main); ImageView mImageView = (ImageView)findViewById(R.id.image_logo); AlphaAnimation mAlphaAnimation = new AlphaAnimation(0.0f, 1.0f); mAlphaAnimation.setDuration(3000); mImageView.setAnimation(mAlphaAnimation); mAlphaAnimation.setAnimationListener(new AnimationListener() { @Override public void onAnimationStart(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationRepeat(Animation animation) { // TODO Auto-generated method stub } @Override public void onAnimationEnd(Animation animation) { // TODO Auto-generated method stub Intent mIntent = new Intent(UI_Test_Animation2Activity.this, SecondActivity.class); startActivity(mIntent); }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
制作Android欢迎界面可以使用以下步骤: 1. 创建一个新的Android项目。 2. 在res/layout目录下创建一个新的布局文件,例如welcome.xml。 3. 在该布局文件添加一个ImageView元素,用于显示欢迎页的图片。 4. 添加一个Button元素,用于在欢迎页上添加一个按钮。 5. 在Java代码,使用setContentView()方法将欢迎页的布局文件设置为主布局。 6. 在Button的onClick()方法,添加代码以实现按钮的响应操作。 下面是一个简单的示例代码: 1. 在res/layout目录下创建一个名为welcome.xml的布局文件,如下所示: ``` <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:id="@+id/welcome_image" android:layout_width="match_parent" android:layout_height="match_parent" android:src="@drawable/welcome_image" /> <Button android:id="@+id/welcome_button" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Get Started" android:layout_centerInParent="true" android:background="@drawable/button_background" android:textColor="@color/white" android:textSize="18sp" /> </RelativeLayout> ``` 2. 在Java代码,使用setContentView()方法将欢迎页的布局文件设置为主布局,如下所示: ``` public class WelcomeActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.welcome); Button button = findViewById(R.id.welcome_button); button.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // 添加按钮响应操作 } }); } } ``` 通过以上步骤,就可以创建一个简单的Android欢迎界面了。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值