深圳全飞鸿

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 645|回复: 3
打印 上一主题 下一主题

empty activity

[复制链接]

104

主题

171

帖子

1187

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1187
跳转到指定楼层
楼主
发表于 2019-5-22 14:05:57 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式
  1. package com.example.administrator.myapplication3;

  2. import android.support.v7.app.AppCompatActivity;
  3. import android.os.Bundle;

  4. public class MainActivity extends AppCompatActivity {

  5.     @Override
  6.     protected void onCreate(Bundle savedInstanceState) {
  7.         super.onCreate(savedInstanceState);
  8.         setContentView(R.layout.activity_main);
  9.     }
  10. }
复制代码
回复

使用道具 举报

104

主题

171

帖子

1187

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1187
沙发
 楼主| 发表于 2019-5-22 14:07:35 | 只看该作者
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3.     package="com.example.administrator.myapplication3">

  4.     <application
  5.         android:allowBackup="true"
  6.         android:icon="@mipmap/ic_launcher"
  7.         android:label="@string/app_name"
  8.         android:roundIcon="@mipmap/ic_launcher_round"
  9.         android:supportsRtl="true"
  10.         android:theme="@style/AppTheme">
  11.         <activity android:name=".MainActivity">
  12.             <intent-filter>
  13.                 <action android:name="android.intent.action.MAIN" />

  14.                 <category android:name="android.intent.category.LAUNCHER" />
  15.             </intent-filter>
  16.         </activity>
  17.     </application>

  18. </manifest>
复制代码
回复 支持 反对

使用道具 举报

104

主题

171

帖子

1187

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1187
板凳
 楼主| 发表于 2019-5-22 14:08:16 | 只看该作者
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"
  4.     xmlns:tools="http://schemas.android.com/tools"
  5.     android:layout_width="match_parent"
  6.     android:layout_height="match_parent"
  7.     tools:context="com.example.administrator.myapplication3.MainActivity">

  8.     <TextView
  9.         android:layout_width="wrap_content"
  10.         android:layout_height="wrap_content"
  11.         android:text="Hello World!"
  12.         app:layout_constraintBottom_toBottomOf="parent"
  13.         app:layout_constraintLeft_toLeftOf="parent"
  14.         app:layout_constraintRight_toRightOf="parent"
  15.         app:layout_constraintTop_toTopOf="parent" />

  16. </android.support.constraint.ConstraintLayout>
复制代码
回复 支持 反对

使用道具 举报

104

主题

171

帖子

1187

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1187
地板
 楼主| 发表于 2019-5-22 14:12:03 | 只看该作者
values 目录下:

colors.xml


  1. <?xml version="1.0" encoding="utf-8"?>
  2. <resources>
  3. <color name="colorPrimary">#3F51B5</color>
  4. <color name="colorPrimaryDark">#303F9F</color>
  5. <color name="colorAccent">#FF4081</color>
  6. </resources>
复制代码






strings.xml

  1. <resources>
  2.     <string name="app_name">My Application3</string>
  3. </resources>
复制代码




styles.xml

  1. <resources>

  2.     <!-- Base application theme. -->
  3.     <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  4.         <!-- Customize your theme here. -->
  5.         <item name="colorPrimary">@color/colorPrimary</item>
  6.         <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  7.         <item name="colorAccent">@color/colorAccent</item>
  8.     </style>

  9. </resources>
复制代码


回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|nagomes  

GMT+8, 2025-6-29 01:15 , Processed in 0.055824 second(s), 23 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表