Allign的TextView与进度的进度 [英] Allign TextView with the progress of progressbar

查看:210
本文介绍了Allign的TextView与进度的进度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我怎么能allign一个的TextView 与水平的进步进度。我想提出一个的TextView 右侧的进度进度位置上方。的进度可能会改变。另外,我想在的TextView 被关在同一行,虽然文本长度可能会更改。

How can I allign a TextView with the progress of a horizontal ProgressBar. I want to put a TextView right above the progress position of the ProgressBar. The progress might be changed. Also, I want the TextView to be kept in one line, although the text length might be changed.

推荐答案

在其中包含您的TextView和进度条设置重力中心,使其保持他们两个中心的神韵父布局。

In the parent layout which contains your TextView and Progress bar set the gravity to center so that it will keep both of them center alligned.

<LinearLayout
   android:layout_width="match_parent"
   android:layout_width="wrap_content"
   android:orientation="vertical"
   android:gravity="center">

   <TextView
      android:layout_width="wrap_content"
      android:layout_width="wrap_content"
      android:text="Hiee"/>


   <ProgressBar
      android:layout_width="wrap_content"
      android:layout_width="wrap_content"/>
</LinearLayout>

这篇关于Allign的TextView与进度的进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆