Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在以编程方式创建一个 RelativeLayout,因此,我需要添加这个 xml 属性:以android:clickable="true"编程方式。
android:clickable="true"
如何才能做到这一点?谢谢!
你必须使用setClickable(true). 查看文档
setClickable(true)