How do I vertically align an item within a list using relative layout?

后端 未结 3 2188
说谎
说谎 2020-12-19 08:37

I am using a list view in Android 1.5 to show a list of images and text next to the image. I am trying to vertically center the text but the text is at the top of the row i

3条回答
  •  误落风尘
    2020-12-19 08:48

    Was stuck on a similar issue for a while, but found this from CommonsWare:

    "When you inflate the layout, use inflate(R.layout.whatever, parent, false), where parent is the ListView."

    Works but only when you set the height of the row to a specific value (ie you can't use wrap_content).

提交回复
热议问题