qq_53827862 2022-05-23 14:34 采纳率: 97.3%
浏览 22
已结题

android如何实现文本居中的同时在右边增加三个按钮

img


如图,文本居中,右边或左边增加三个圆点按钮,如何android实现

  • 写回答

2条回答 默认 最新

  • 不会写代码的猴子 Android领域优质创作者 2022-05-23 14:50
    关注
    <?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <ImageView
            android:id="@+id/iv_1"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"/>
    
        <ImageView
            android:id="@+id/iv_2"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"
            android:layout_toEndOf="@+id/iv_1"/>
    
        <ImageView
            android:id="@+id/iv_3"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"
            android:layout_toEndOf="@+id/iv_2"/>
        
        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="我在最中间"
            android:layout_centerHorizontal="true"/>
    
    
        <ImageView
            android:id="@+id/iv_4"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"
            android:layout_alignParentEnd="true"/>
    
        <ImageView
            android:id="@+id/iv_5"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"
            android:layout_toStartOf="@+id/iv_4"/>
    
        <ImageView
            android:id="@+id/iv_6"
            android:layout_width="20dp"
            android:layout_height="20dp"
            android:background="@drawable/circle_shape"
            android:layout_toStartOf="@+id/iv_5"/>
    </RelativeLayout>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

问题事件

  • 系统已结题 6月1日
  • 已采纳回答 5月24日
  • 创建了问题 5月23日

悬赏问题

  • ¥15 opencv图像处理,需要四个处理结果图
  • ¥15 无线移动边缘计算系统中的系统模型
  • ¥15 深度学习中的画图问题
  • ¥15 java报错:使用mybatis plus查询一个只返回一条数据的sql,却报错返回了1000多条
  • ¥15 Python报错怎么解决
  • ¥15 simulink如何调用DLL文件
  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。