constraint layout - Two views with largest width

前端 未结 3 1951
你的背包
你的背包 2021-01-03 08:46

I want to create a layout (using constraint layout) like the following:

In different languages Button1 may be larger than button2. How can I do this?

<
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-03 08:58

    I stumbled upon this question and was able to solve it with androidx.constraintlayout.widget.Barrier which were introduced in 1.1.0-beta1 of constraint layout. So I thought it'd be nice to share with people who run into the same issue:

    
    
        

    Haven't been able to center them horizontally, so if someone figures that out I'll update this example.

提交回复
热议问题