简体   繁体   中英

Why does "Infer Constraints" in the UI Design Builder set the layout height and width of some views to 0dp?

  • I clicked "Infer Constraints"
  • My Text views were fine but my Button and EditText views' layout height and width are automatically set to 0dp, rendering them invisible.
  • I'm not sure if it's a bug or just a natural effect of this feature

0dp is not a bug, it means match_constraints ; so android studio tries to infer the constraints according to how you laid out your views with relation to each other and to the parent ConstraintLayout .

For more info check here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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