安卓开发学习——day1

今天是学习安卓的第3天

由于以前没有接触过安卓,这几天的学习就像盲人过河,看一点写一点。对于安卓的了解不是很深入。
这几天主要用到的布局就是:LinearLayout GridLayout
控件主要使用到的是:TextView ImageButton EditView


遇到的问题也很多,比如按比例布局这些,经过百度查找:
将外层的线性表,添加:

android:orientation="vertical"

将线性布局设置为水平

内部,添加:

android:latyout_height="0dp"
android:layout_weight="X"

其实x就是所占比例

做出这些就能实现布局

在这里插入图片描述


还有将按钮边框设置圆角边框,经过查看老师的笔记,实现了圆角边框:
新建xml:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <corners android:radius="10dp"/>
    <solid android:color="@color/white"/>
    <
    <stroke
        android:width="1dp"
        android:color="#555555"/>
</shape>

其中corner是设置圆角
solid设置内部填充颜色
staoke设置描边

然后在文件中调用:

android:background="@drawable/custom_border"

实现圆角边框
在这里插入图片描述


隐藏状态栏:
修改style.xml:

<style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

修改配置文件:Mainfest文件

android:theme="@style/AppTheme"

在这里插入图片描述
去掉状态栏时,发现按钮颜色也发生了改变,这应该时根据那三个颜色来实现取消状态连


同时还有很多问题没有解决,只有留在后面了

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 5
    评论
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值