Android Fragment does not respect match_parent as height

I had the same problem and think it happens when you inflate the layout in the Fragment’s onCreateView with null, like you did here:

mRootView = (ViewGroup) inflater.inflate(R.layout.list_content, null);

Instead you have to do this:

mRootView = (ViewGroup) inflater.inflate(R.layout.list_content,container, false);

Where container is the Viewgroup. At least, that solved the problem for me.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)