I want to display text at the end of EditText as shown in the image above for URLName.How could I acheive this ?The text cannot be edited.I am using this editText inside TextInputLayout
from the design library. thanks in advance
相关问题
- How can I create this custom Bottom Navigation on
- Bottom Navigation View gets Shrink Down
- How to make that the snackbar action button be sho
- Listening to outgoing sms not working android
- How to create Circular view on android wear?
相关文章
- android开发 怎么把图片放入drawable的文件夹下
- android上如何获取/storage/emulated/下的文件列表
- androidStudio有个箭头不认识
- SQLite不能创建表
- 放在input的text下文本一直出现一个/(即使还没输入任何值)是什么情况
- Windows - Android SDK manager not listing any plat
- Animate Recycler View grid when number of columns
- Why is the app closing suddenly without showing an
This worked for me :
It's little bit tricky but it's works for me.
BUT
If you want to set only EditText then you can do below :
Reference : Setting cursor to the right on an EditText with HINT Gravity to center
Create a
LinearLayout
. An example of a row inside this layout would be a title (i.e. URL name) or a text entry field.Set the background of the
LinearLayout
for the current row to a custom drawable to create a thin red line. Follow the answers on this post for ideas.For the URL entry field mentioned in your question, create a
TextView
and anEditText
inside anotherLinearLayout
inside the current row.The
TextView
will contain ".sitename.com". Set it towrap_content
and give it aweight
of0
. For yourEditText
, set itswidth
to0dp
and itsweight
to1
. It should now fill all remaining space. Set thebackground
to@null
for both.