Android studio第一次使用记录

一:创建工程
这边有模板可以选择,可以直接选择Empty Activity。
在这里插入图片描述
二:配置
应用名称
程序包名称
本地地址在这里插入图片描述
三:进入工程
在这里插入图片描述
首先布局layout
在这里插入图片描述
上图各部分收缩省略图
线性布局命令:LinearLayout
插图图片:ImageView

 <LinearLayout
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"       //高度宽度自适应
        android:orientation="horizontal">          //横向布局
        
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"       //距离左边15dp
            android:layout_marginTop="15dp"
            android:text="姓名:"
            android:textSize="30dp" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:layout_marginTop="15dp"
            android:text="代用名"
            android:textSize="30dp" />
    </LinearLayout>                                 // 线性布局收尾

整体上下嵌套
四:更改APP图标、名称
1、更改图标
在这里插入图片描述
AndroidManifest是什么?
AndroidManifest官方解释是应用清单(manifest意思是货单),每个应用的根目录中都必须包含一个,并且文件名必须一模一样。这个文件中包含了APP的配置信息,系统需要根据里面的内容运行APP的代码,显示界面。

图标配置信息也是包含在AndroidManifest.xml文件中
我在res文件夹下又发现了一个mipmap-anydpi-v26文件夹

android:roundIcon="@mipmap/ic_launcher_round"   //圆形图标
android:icon ="@mipmap/icon"                    //普通图标

mipmap-anydpi-v26是为了android8.0新增的
2、更改应用名

应用名配置信息也是包含在AndroidManifest.xml文件中

    <application
        android:allowBackup="true"   
        android:icon="@mipmap/title"                      //普通图标
        android:label="@string/app_name"            //应用名
        android:roundIcon="@mipmap/title"           //圆形图标
        android:supportsRtl="true"
        android:theme="@style/AppTheme">
        <activity android:name=".MainActivity">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值