RelativeLayout 详解 之58同城

研一脑电小白日记 之 EEGLAB预处理实战指南 本文为脑电研究新手提供了一份详尽的EEGLAB预处理实战指南。从MATLAB与EEGLAB环境搭建、使用NeuracleEEGFileReader插件导入BDF格式数据开始,逐步讲解了电极定位、滤波、降采样、ICA去伪迹等核心步骤,旨在帮助初学者高效完成脑电数据预处理,为后续分析奠定坚实基础。 阅读详情

RelativeLayout

看不懂,标题的,可以耐心看完

顾名思义,里面控件的位置都是相对的,
定义好其中一个控件A的位置,然后其他的都可以相对于这个控件A或者是其已经与控件A建立相对位置关系的控件建立关系

尽量不要在相对管理里牵扯出多个控件id, 不然会牵一发,动全身的

这是网上看到的别人总结的,大家看完,心中有数, 然后记下我的3句话,就可以搞定RelativeLayout, 没耐心,可看不到下面的重点四句话

第一类:属性值为true或false
android:layout_centerHrizontal                                           水平居中
android:layout_centerVertical                                            垂直居中
android:layout_centerInparent                                           相对于父元素完全居中
android:layout_alignParentBottom                                     贴紧父元素的下边缘
android:layout_alignParentLeft                                          贴紧父元素的左边缘
android:layout_alignParentRight                                        贴紧父元素的右边缘
android:layout_alignParentTop                                          贴紧父元素的上边缘
android:layout_alignWithParentIfMissing                            如果对应的兄弟元素找不到的话就以父元素做参照物

第二类:属性值必须为id的引用名“@id/id-name”
android:layout_below                          在某元素的下方
android:layout_above                          在某元素的的上方
android:layout_toLeftOf                       在某元素的左边
android:layout_toRightOf                     在某元素的右边

android:layout_alignTop                      本元素的上边缘和某元素的的上边缘对齐
android:layout_alignLeft                      本元素的左边缘和某元素的的左边缘对齐
android:layout_alignBottom                 本元素的下边缘和某元素的的下边缘对齐
android:layout_alignRight                    本元素的右边缘和某元素的的右边缘对齐

第三类:属性值为具体的像素值,如30dip,40px
android:layout_marginBottom              离某元素底边缘的距离
android:layout_marginLeft                   离某元素左边缘的距离
android:layout_marginRight                 离某元素右边缘的距离
android:layout_marginTop                   离某元素上边缘的距离

四句话

  1. 在谁的左边或右边 :

            二个关键字搞定 : toLeft-XX toRight-XX
    
  2. 在谁的上面或下面 :

             二个单词搞定:   X-below-X   X-above-X
    
  3. 与谁谁对齐:

            一个关键词: X-alignLeft_X
    
  4. 还有一个爸爸

              X_center_X   X_parent_X 
    

注意: 我的四句话,是关键字,大家心里默默记下, 多加练习,用联想记忆

RelativeLayout布局,很简单,那么如何练习呢? 我发现最好的方式,就是用相对布局,把数字1- 10用button练习,就可以,下面,就是我做的58相对布局,大家,可以试试写一写

这里写图片描述

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:padding="10dp"
    android:layout_height="match_parent">


    <Button
        android:id="@+id/one"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_centerVertical="true"
        android:background="#e61212" />

    <Button
        android:id="@+id/two"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/one"
        android:background="#e61212" />

    <Button
        android:id="@+id/three"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/two"
        android:background="#e61212" />
    <Button
        android:id="@+id/four"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/three"
        android:background="#e61212" />
    <Button
        android:id="@+id/five"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/four"
        android:layout_alignBottom="@id/four"
        android:background="#e61212" />
    <Button
        android:id="@+id/six"
        android:layout_width="45dp"
        android:layout_toRightOf="@id/five"
        android:layout_height="45dp"
        android:layout_alignBottom="@id/five"
        android:background="#e61212" />
    <Button
        android:id="@+id/seven"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/one"
        android:layout_alignBottom="@id/one"
        android:background="#e61212" />
    <Button
        android:id="@+id/eight"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/seven"
        android:layout_alignBottom="@id/seven"
        android:background="#e61212" />
    <Button
        android:id="@+id/nine"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_below="@id/eight"
        android:layout_alignLeft="@id/eight"
        android:background="#e61212" />
    <Button
        android:id="@+id/ten"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_below="@id/nine"
        android:layout_alignLeft="@id/nine"
        android:background="#e61212" />

    <Button
        android:id="@+id/eleven"
        android:layout_width="45dp"
        android:layout_below="@id/ten"
        android:layout_height="45dp"
        android:layout_alignLeft="@id/ten"
        android:background="#e61212" />
    <Button
        android:id="@+id/twelve"
        android:layout_width="45dp"
        android:layout_toLeftOf="@id/eleven"
        android:layout_height="45dp"
        android:layout_alignBottom="@id/eleven"
        android:background="#e61212" />
    <Button
        android:id="@+id/thirteen"
        android:layout_width="45dp"
        android:layout_toLeftOf="@id/twelve"
        android:layout_height="45dp"
        android:layout_alignBottom="@id/twelve"
        android:background="#e61212" />
    <!-- 以上是5字 相对布局>-->


    <Button
        android:id="@+id/fourteen"
        android:layout_width="45dp"
        android:layout_centerInParent="true"
        android:layout_height="45dp"
        android:background="#e61212" />
    <Button
        android:id="@+id/fifteen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/fourteen"
        android:layout_alignLeft="@id/fourteen"
        android:background="#e61212" />
    <Button
        android:id="@+id/sixteen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/fifteen"
        android:layout_alignLeft="@id/fifteen"
        android:background="#e61212" />
    <Button
        android:id="@+id/seventeen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/sixteen"
        android:layout_alignLeft="@id/sixteen"
        android:background="#e61212" />
    <Button
        android:id="@+id/eighteen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_alignBottom="@id/seventeen"
        android:layout_toRightOf="@id/seventeen"
        android:background="#e61212" />
    <Button
        android:id="@+id/nineteen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_alignBottom="@id/eighteen"
        android:layout_toRightOf="@id/eighteen"
        android:background="#e61212" />
    <Button
        android:id="@+id/twenty"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/nineteen"
        android:layout_alignBottom="@id/nineteen"
        android:background="#e61212" />
    <Button
        android:id="@+id/oone"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_below="@id/twenty"
        android:layout_alignLeft="@id/twenty"
        android:background="#e61212" />

    <Button
        android:id="@+id/otwo"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_below="@id/oone"
        android:layout_alignLeft="@id/oone"
        android:background="#e61212" />

    <Button
        android:id="@+id/othree"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_below="@id/otwo"
        android:layout_alignLeft="@id/otwo"
        android:background="#e61212" />
    <Button
        android:id="@+id/ofour"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toLeftOf="@id/othree"
        android:layout_alignTop="@id/othree"
        android:background="#e61212" />
    <Button
        android:id="@+id/ofive"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toLeftOf="@id/ofour"
        android:layout_alignTop="@id/ofour"
        android:background="#e61212" />
    <Button
    android:id="@+id/osix"
    android:layout_width="45dp"
    android:layout_below="@id/fourteen"
    android:layout_height="45dp"
    android:layout_alignLeft="@id/fourteen"
    android:background="#e61212" />
    <Button
        android:id="@+id/oseven"
        android:layout_width="45dp"
        android:layout_below="@id/osix"
        android:layout_height="45dp"
        android:layout_alignLeft="@id/osix"
        android:background="#e61212" />
    <Button
        android:id="@+id/oeight"
        android:layout_width="45dp"
        android:layout_below="@id/oseven"
        android:layout_height="45dp"
        android:layout_alignLeft="@id/oseven"
        android:background="#e61212" />
    <Button
        android:id="@+id/onine"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/oeight"
        android:layout_alignBottom="@id/oeight"
        android:background="#e61212" />
    <Button
        android:id="@+id/oten"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/onine"
        android:layout_alignBottom="@id/onine"
        android:background="#e61212" />
    <Button
        android:id="@+id/oeleven"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_toRightOf="@id/oten"
        android:layout_alignBottom="@id/oten"
        android:background="#e61212" />
    <Button
        android:id="@+id/otwelve"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/oeleven"
        android:layout_alignLeft="@id/oeleven"
        android:background="#e61212" />
    <Button
        android:id="@+id/othirteen"
        android:layout_width="45dp"
        android:layout_height="45dp"
        android:layout_above="@id/otwelve"
        android:layout_alignLeft="@id/otwelve"
        android:background="#e61212" />
</RelativeLayout>
全面指南:PyTorch与ROCm版本兼容性及多版本环境管理 本文详细介绍了在AMD GPU上配置PyTorch开发环境的完整流程,重点解决版本兼容性和多版本ROCm环境管理问题。主要内容包括:1) PyTorch与ROCm版本对应关系查询;2) 四种查看ROCm版本的方法;3) 使用update-alternatives管理多版本ROCm;4) 环境变量配置与冲突解决方案;5) 完整的验证流程和性能测试方法。文章提供了最佳实践建议和故障排除清单,帮助开发者快速搭建稳定高效的深度学习开发环境,充分发挥AMD GPU硬件性能。通过系统化的验证流程确保各组件协同工作,解决 阅读详情

相关推荐

生成式引擎优化(GEO)的概念与技术路径

生成式引擎优化(GEO)是针对生成式AI引擎的新型优化策略,旨在提升内容在AI搜索与问答平台中的可见性和可信度。与传统SEO相比,GEO更注重语义理解、知识图谱和多模态生成等技术,通过优化内容的结构化和平台适配性,使品牌信息在生成式AI中更易被采纳和呈现。其核心技术包括语义理解、向量数据库和实时反馈优化等,应用于品牌传播、智能客服和个性化推荐等领域。随着AI技术发展,GEO将向智能化、自动化方向演进,成为内容优化的重要工具。

Baixue5209的博客 1047

Android五大布局Layout

Android开发中,我们可能会遇到过一些很复杂的布局,对于初学者来说,可能脑子会嗡的一下,“这么复杂!该怎么整?!”。 不要担心!再复杂的布局其实也是由简单地布局组成的,我们要学会将它分解成基本的布局,那么问题就迎刃而解了。 Android共有五种常见布局方式,分别是:LinearLayout(线性布局),FrameLayout(单帧布局),AbsoluteLayout(绝对布局),

Google、在奋斗 3751

手把手教你搭建Howland电流源:从原理图到实测避坑指南(附Python数据分析)

本文详细介绍了Howland电流源的设计与实现,从原理图到实测避坑指南,涵盖电阻匹配、运放选择和PCB布局等关键环节。通过Python数据分析,展示了如何优化电路性能并解决常见问题,适合电子工程师和爱好者参考。

weixin_29291069的博客 632

Android : layout

布局(Layout) 的概念针对的是Activity。Activity是布满整个Android设备的窗口或者悬浮于其他窗口上的交互界面。XML布局文件是Android系统中定义 Layout 的常用方式,所有布局文件都包含在 res/layout 目录中。当 res/layout 目录下新增了布局文件后,R.java文件会自动收录该布局资源,Java代码可通过setContentView 方法在Activity中显示该Layout。

yangjinjingbj的博客 2645

ABAP BAPI_PRODORD_CHANGE函数详解:如何高效重读生产订单主数据

本文深入解析ABAP BAPI_PRODORD_CHANGE函数在生产订单主数据高效处理中的应用。通过详细讲解函数架构、主数据重读机制及实战代码示例,帮助开发人员掌握生产订单数据的精准读取与更新技术,提升SAP系统集成与自动化处理效率。

weixin_29207149的博客 467

半导体EAP系统入门指南:从零开始理解设备自动化程序(附实战案例)

本文深入浅出地介绍了半导体制造中EAP(设备自动化程序)系统的核心作用与工作原理。EAP作为连接MES与生产设备的桥梁,负责指令翻译、数据采集与实时控制,是实现晶圆厂全自动化的关键。文章通过对比手动与自动模式,阐述了EAP在提升效率、保障良率方面的价值,并提供了一个实战案例,帮助读者从零构建对半导体CIM体系中这一关键组件的理解。

weixin_29200741的博客 734

Android之Layout总结

之前自己在用Layout的时候用的最多的就是LinearLayout和RelativeLayout了,对其他的其实也只是一知半解。近来也是接触到了更多的Layout在实际中的用途,也算是有了更多的认识。 我现在接触到的比较多的Layout分为几种:LinearLayout,RelativeLayout,FrameLayout,ConstraintLayout。最后再讲一下自己去自定义layout...

758

《UDS协议从入门到精通》系列——图解0x38:请求文件传输

详细解释UDS协议中0x38-请求上传服务的各个参数!!

车载系统攻城狮 3264

Android中的布局layout和视图View+常用的几种容器视图的使用(未完)

别的安卓笔记看不懂怎么办

weixin_50880491的博客 2220

想重装OpenClaw?先执行这4步彻底卸载,避免配置冲突

在重装OpenClaw之前,彻底卸载是非常重要的一步。如果不彻底卸载,可能会导致: - 残留的配置文件与新安装的版本冲突 - 旧的依赖包干扰新的安装过程 - 服务冲突导致启动失败 - 数据混乱影响系统稳定性

一键难忘的博客 1043

Modbus测试工具ModbusPoll与Modbus Slave使用方法 小白实操记录

Modbus 下面介绍modbus标准协议从站、主站仿真工具;可用于指令下发,数据采集等;是学习、现场运维的好工具。 1 介绍 Modbus Poll :Modbus主机仿真器,用于测试和调试Modbus从设备。该软件支持ModbusRTU、ASCII、TCP/IP。用来帮助开发人员测试Modbus从设备,或者其它Modbus协议的测试和仿真。它支持多文档接口,即,可以同时监视多个从设备/数据域。每个窗口简单地设定从设备ID,功能,地址,大小和轮询间隔。你可以从任意一个窗口读写寄存器和线圈。如果你想改

码灵的博客 1万+

Android |(五)基础布局Layout

轻松构建复杂的界面结构。其高效性和灵活性使得布局嵌套大幅减少,从而提升了界面性能。

codeSong的博客 1498

FineReport FCP模拟题五

新建决策报表,设置 移动端 格式,采用绝对布局。数据来源:FRDemo中的订单表/雇员表。

Davina_yu的博客 724

Android进阶之路 - 实现58同城APP加载中页面

此文引用的是58同城的加载动画,虽然出来有一些年头了,但我表示使用的时候因技术原因我还是遇到了一些或大或小的坑。Effect :原作者的Git地址:https://github.com/zzz40500/android-shapeLoadingView首先在build.gradle (app) 导入依赖 :compile 'com.github.zzz40500:android-shapeLoadi

Android、前端、小程序、后端 1664

霍尼韦尔SoftMaster使用说明

霍尼韦尔SoftMaster使用说明

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

简单的RelativeLayout布局

简单的RelativeLayout布局实例 1 <?xml version="1.0" encoding="utf-8"?> 2 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 3 android:layout_width="match_pare...

weixin_30381793的博客 80

Statistics and Machine Learning Toolbox

Statistics and Machine Learning Toolbox(带书签),MATLAB统计学习工具

Android: RelativeLayout作为ListView时的布局BUG

当一个ListView的item为一个RelativeLayout时,该ViewGroup下的子view如果配置为 android:layout_alignParentBottom="true",本来是让子view靠近RelativeLayout的底部,但实际运行结果却是靠到顶部。 [img]http://dl.iteye.com/upload/attachment/378692/...

loop in codes 269

锂电池充电器电路设计 里面有电路

锂电池充电器电路设计 里面有电路 3.7V升压到5V电路设计。

Android Studio开发学习(七)———RelativeLayout(相对布局)

在上期中我们对进行了详细的解析,也是我们用的比较多的一个布局,更多的时候更钟情于它的weight(权重)属性,等比例划分,对屏幕适配还是 帮助蛮大的;但是使用的时候也有一个问题,就是当界面比较复杂的时候,需要嵌套多层的,这样就会降低UI Render的效率(渲染速度),而且如果是或者上的item,效率会更低,另外太多层嵌套会占用更多的系统资源,还有可能引发;但是如果我们使用的话,可能仅仅需要一层就可以完成了,以父容器或者兄弟组件参考+margin+padding。

m0_73391179的博客 927

相对布局relativeLayout

相对布局relativeLayout 一、简介   二、实例 代码 /Test_FrameLayout/res/layout/relativelayout.xml android:layout_centerHorizontal="true" android:layout_toRightOf="@+id/qq_icon" android:layout_marginTop="1...

weixin_33953249的博客 97

RelativeLayout用到的一些重要的属性

Android中RelativeLayout相对布局 RelativeLayout用到的一些重要的属性: 第一类:属性值为true或falseandroid:layout_centerHrizontal 水平居中android:layout_centerVertical 垂直居中android:layout_centerInparent 相对于父元素完全居中android:layout_...

jc_dreaming2的博客 99

gitHub-高仿58同城加载动画

导入方式: /build.gradle repositories { maven { url "https://jitpack.io" } } /app/build.gradle dependencies { compile 'com.github.zzz40500:android-shapeLoadin...

weixin_30878361的博客 125

RelativeLayout与LinearLayout的比较

转自:http://blog.youkuaiyun.com/onepiece2/article/details/26396287 RelativeLayout 是相对布局在页面上相对于页面坐标进行布局设置。比如可以通过确定对象A确定对象B的位置,B可以在A的上下左右,对象B距离A的位置。 RelativeLayout的灵活性很高,但在实际操作过程中我很难确定定位对象的位置,最后用图形界面手托才完成页面的...

weixin_30516243的博客 95

Android 开发笔记___RelativeLayout

xml文件实现 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" 2 android:layout_width="match_parent" 3 android:layout_height="500dp" > 4 5 &l...

weixin_30532987的博客 141

大模型+PowerMCP驱动PSCAD电磁暂态仿真自动化

MCP(模型上下文协议)是让大模型通过标准化工具调用连接专业软件的基础机制。其原理是把PSCAD的自动化接口封装为可描述、可校验的工具集,由大模型完成意图理解、工具选择与参数填充,服务端负责工程加载、参数扫描、运行排队、结果指标提取与异常检查。技术价值在于将电磁暂态仿真中高频重复的工况扫描从人工调度转为可复现的自动流程,减少改参、跑例、导曲线和整理表格带来的人为失误。应用场景覆盖电力系统故障暂态分析、新能源并网与柔直研究中的多工况对比。大模型+PowerMCP+PSCAD的组合正是沿此路径,把自然语言需求落

weixin_34357887的博客 343

relativelayout常用属性

===================================================================================== 整理于http://naotu.baidu.com/file/e5880b84b1a906838116f7a45f58de78

Sundy的日记 268

相对布局父类属性_376,用代码编写子view和父类的关系如:RelativeLayout.addRule()和removeRule()...

通过LayoutParams的 addRule方法来额外的添加别的规则了,android.widget.RelativeLayout.LayoutParams.addRule(int verb, int anchor),其中 anchor 参数指定可以是 View 的 id(“相对于谁”)、RelativeLayout.TRUE(启用某种对齐方式)或者 是-1(应用于某些不需要 anchor 的 ...

weixin_35897916的博客 218
上一篇: XML解析之SAX解析
下一篇: 初学者都应该看的 --- Activity的生命周期
android_lyp
博客等级 码龄11年 14粉丝 39原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值