Percentage width in a RelativeLayout

后端 未结 14 1774
遥遥无期
遥遥无期 2020-11-22 13:54

I am working on a form layout for a Login Activity in my Android App. The image below is how I want it to look like:

14条回答
  •  太阳男子
    2020-11-22 14:27

    Update 1

    As pointed by @EmJiHash PercentRelativeLayout is deprecated in API level 26.0.0

    Below quoting google comment:

    This class was deprecated in API level 26.0.0. consider using ConstraintLayout and associated layouts instead. The following shows how to replicate the functionality of percentage layouts with a ConstraintLayout


    Google introduced new API called android.support.percent

    Then you can just specify percentage to take by view

    Add compile dependency like

    implementation 'com.android.support:percent:22.2.0
    

    in that, PercentRelativeLayout is what we can do a percentage wise layout

     
         
     
    

提交回复
热议问题