Why do I need to wrap an ImageView into a FrameLayout?

前端 未结 6 2126
醉话见心
醉话见心 2020-12-14 01:00

Here is a simple layout:

      

         


        
6条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-14 01:32

    If you do android:scaleType="FIT_END", without the FrameLayout, does that put the Subway image near the "Subway" text? I wonder, because you have android:layout_alignParentLeft="true" in there. I'm thinking that the ImageView's original size before the scaling is what is throwing off the layout without a FrameLayout.

    It probably doesn't matter too much, but it does take some processing to scale and resize the image for what you want it to do. If it is viable for what you want to do, I'd simply resize the image myself instead of relying on XML. If I wanted to cater to multiple sizes, I would have a couple of different layouts made. This of course may be overkill for your purpose, I do not know.

提交回复
热议问题