简体   繁体   English

使用EditText的drawableRight作为锚点

[英]Use drawableRight of EditText as anchor

I want to use the drawableRight of EditText as an anchor view for something. 我想将EditTextdrawableRight用作某些内容的锚点视图。
But there isn't any method to get drawableRight . 但是没有任何方法可以获取drawableRight

Is there a way to achieve this? 有没有办法做到这一点?

Programmatically : 以编程方式:

edt.setCompoundDrawablesRelativeWithIntrinsicBounds(0, R.drawable.ic_right, 0, 0);

edt.setCompoundDrawablesWithIntrinsicBounds(null, null, getResources().getDrawable(android.R.drawable.ic_right), null);

XML : XML:

android:drawableRight="@drawable/ic_right"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM