开发者

Which Layout is better for my app?

开发者 https://www.devze.com 2023-01-27 09:11 出处:网络
I would like to create an app that has two images side by side and two radioButtons, on开发者_开发技巧e down of every image. Which Layout is more suitable for this job (tableLayout, Linear or Relative

I would like to create an app that has two images side by side and two radioButtons, on开发者_开发技巧e down of every image. Which Layout is more suitable for this job (tableLayout, Linear or Relative..)? I have tried it with linear but the images are stacked together.


You can use any of them, with different effort and cost for your application.

The easiest is probably to use a TableLayout, but it's more resourceful.

RelativeLayout is very efficient, but harder to learn and perhaps a little difficult to understand later.

I think you should go with 2 linear Layouts.

  • LinearLayout (horizontal)
    • LinearLayout (vertical)
      • Image
      • Radio Button
    • LinearLayout (vertical)
      • Image
      • Radio Button

If you need the rows to be always exact same height, using TableLayout is not a bad idea too.

0

精彩评论

暂无评论...
验证码 换一张
取 消