Advertisement
Guest User

Untitled

a guest
Feb 27th, 2014
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.41 KB | None | 0 0
  1. public void OnTabSelected(ActionBar.Tab tab, FragmentTransaction ft)
  2. {
  3.         DisplayContactFragment(tab);
  4. }
  5.  
  6. private void DisplayContactFragment(ActionBar.Tab tab)
  7. {
  8.         ContactFragment fragment = new ContactFragment();
  9.         SupportFragmentManager.BeginTransaction().Replace(Resource.Id.fragmentContainer, fragment).Commit();
  10. }
  11.  
  12. -------------------------------------
  13.  
  14.     public class ContactFragment : Fragment
  15.     {        
  16.         public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
  17.         {
  18.             View v = inflater.Inflate(Resource.Layout.Contact, container, false);
  19.             v.LayoutParameters = new ViewGroup.LayoutParams(new ViewGroup.LayoutParams(
  20.                 ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent));
  21.     }
  22.  
  23. -------------------------------------
  24.  
  25. <?xml version="1.0" encoding="utf-8"?>
  26. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  27.     android:orientation="vertical" android:layout_width="fill_parent"
  28.   android:fillViewport="true"
  29.     android:layout_height="fill_parent">
  30.   <LinearLayout android:background="#FF0000"
  31.         android:layout_height="0dp" android:layout_width="fill_parent"
  32.         android:layout_weight="1" />
  33.   <LinearLayout android:background="#00FF00"
  34.         android:layout_height="0dp" android:layout_width="fill_parent"
  35.         android:layout_weight="1" />
  36. </LinearLayout>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement