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 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥15 可见光定位matlab仿真