Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Layout_weight and Fragment

$
0
0

Hi, I have small application with ActionBar. On tab select I switch view using code below:

ContactFragment fragment = new ContactFragment(); SupportFragmentManager.BeginTransaction().Replace(Resource.Id.fragmentContainer, fragment).Commit();

Contact fragment is also simple: public class ContactFragment : Fragment { public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View v = inflater.Inflate(Resource.Layout.Contact, container, false); v.LayoutParameters = new ViewGroup.LayoutParams(new ViewGroup.LayoutParams( ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));

    return v;
}

}

And Contact .axml layout

<?xml version="1.0" encoding="utf-8"?>

The problem is that Contact View is blank - when I put the same view for a splash screen it works ok (half red / half green). I can use static dp values instead 0dp and layout_weight but this is not a solution. Is there any way to make layout_weight works in inflated View?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>