当前位置:   article > 正文

Android Studio组件布局-qq说说发布_android studio简易qq空间代码

android studio简易qq空间代码

一、QQ空间布局介绍


先将所要使用的图片导入工程文档当中

在这里插入图片描述
addpicture
在这里插入图片描述
bottom

新建一个工程文件
在这里插入图片描述

将图片放入工程文件夹下的mipmap-mdpi中

在这里插入图片描述
打开APP的acyivity-xlms改写程序

代码如下(示例):

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:background="#EAEAEA"
    android:paddingBottom="16dp"
    android:paddingLeft="16dp"
    android:paddingRight="16dp"
    android:paddingTop="16dp"
    tools:context="com.example.qq.MainActivity">
    <EditText
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:lines="6"
        android:hint="说点什么吧"
        android:background="#FFFFFF"
        android:padding="5dp"
        android:gravity="top"
        android:layout_marginBottom="10dp"
        android:inputType="textMultiLine"/>
    <TextView
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="#FFFFFF"
        android:drawableLeft="@mipmap/addpicture"
        android:drawablePadding="8dp"
        android:gravity="center_vertical"
        android:padding="8dp"
        android:text="添加照片"/>

    <ImageView
        android:layout_width="379dp"
        android:layout_height="wrap_content"
        android:scaleType="fitXY"
        android:src="@mipmap/bottom" />
</LinearLayout>
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38

在这里插入图片描述

这里是页面布局
在这里插入图片描述

调试结果
在这里插入图片描述
在这里插入图片描述
可以看出这里只可以输入六行内容,多出的就覆盖了。

总结

只是一个供参考的小程序,欢迎大家前来讨论交流

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/292893
推荐阅读
相关标签