Android layout as button with selectable functionality

后端 未结 1 1186
我在风中等你
我在风中等你 2021-02-13 07:14

I\'m trying to create a button-like component, with a left-aligned ImageView and then 2 TextViews to the right of the ImageView, stacked one above the other and formatted differ

1条回答
  •  生来不讨喜
    2021-02-13 07:49

    You can add android:duplicateParentState="true" to the ImageView widget. Also you need to make the ImageView's parent clickable and focusable.

    The RelativeLayout in the following code will act as a Button:

    
    
        
    
            
            
            
        
    
    

    0 讨论(0)
提交回复
热议问题