Click here to Skip to main content
15,888,218 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have learnt what is match_parent and wrap_content.But my ouput is not according to the way which i expect.when i give wrap_content and match_parent it is showing the same output.its not wrapping the content

What I have tried:

HTML
<linearlayout
 android:layout_width="match_parent" 
="" android:layout_height="match_parent" android:orientation="vertical">
    <imageview
 android:src="@drawable/ocean" 
="" android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:scaletype="centerCrop">
    <textview
 android:text="hi ra" 
="" android:layout_width="wrap_content" android:layout_height="0dp" android:background="#F50057" android:textsize="24sp" android:layout_weight="0">
    <textview
 android:text="hi ra" 
="" android:layout_width="match_parent" android:layout_height="0dp" android:background="#1E88E5" android:textsize="24sp" android:layout_weight="0">
Posted
Updated 30-Mar-20 2:46am
v2

1 solution

That may well be what it is supposed to look like: ViewGroup.LayoutParams  |  Android Developers[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900