本文整理汇总了C#中Android.Views.ViewGroup类的典型用法代码示例。如果您正苦于以下问题:C# ViewGroup类的具体用法?C# ViewGroup怎么用?C# ViewGroup使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ViewGroup类属于Android.Views命名空间,在下文中一共展示了ViewGroup类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnCreateView
public override View OnCreateView (LayoutInflater layoutInflater, ViewGroup viewGroup, Bundle bundle)
{
var frame = (FrameLayout)layoutInflater.Inflate(Resource.Layout.zxingscannerfragmentlayout, null);
var layoutParams = new LinearLayout.LayoutParams (ViewGroup.LayoutParams.FillParent, ViewGroup.LayoutParams.FillParent);
try
{
scanner = new ZXingSurfaceView (this.Activity, ScanningOptions, callback);
frame.AddView(scanner, layoutParams);
if (!UseCustomView)
{
zxingOverlay = new ZxingOverlayView (this.Activity);
zxingOverlay.TopText = TopText ?? "";
zxingOverlay.BottomText = BottomText ?? "";
frame.AddView (zxingOverlay, layoutParams);
}
else if (CustomOverlayView != null)
{
frame.AddView(CustomOverlayView, layoutParams);
}
}
catch (Exception ex)
{
Console.WriteLine ("Create Surface View Failed: " + ex);
}
return frame;
}
示例2: GetView
public override View GetView(Context context, View convertView, ViewGroup parent)
{
this.Click = delegate { SelectImage(); };
Bitmap scaledBitmap = Bitmap.CreateScaledBitmap(_image, dimx, dimy, true);
var view = convertView as RelativeLayout;
if (view == null)
{
view = new RelativeLayout(context);
_imageView = new ImageView(context);
}
else
{
_imageView = (ImageView)view.GetChildAt(0);
}
_imageView.SetImageBitmap(scaledBitmap);
var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent, ViewGroup.LayoutParams.WrapContent);
parms.SetMargins(5, 2, 5, 2);
parms.AddRule( LayoutRules.AlignParentLeft);
if(_imageView.Parent != null && _imageView.Parent is ViewGroup)
((ViewGroup)_imageView.Parent).RemoveView(_imageView);
view.AddView(_imageView, parms);
return view;
}
示例3: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Use this to return your custom view for this Fragment
// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
// Lich hoc theo HK
var rootView = inflater.Inflate (Resource.Layout.LichHoc_HK, container, false);
isfirst = true;
listView_HK = rootView.FindViewById<ListView> (Resource.Id.listLH);
lbl_HK = rootView.FindViewById<TextView> (Resource.Id.lbl_HK_LH);
lbl_NH = rootView.FindViewById<TextView> (Resource.Id.lbl_NH_LH);
progress = rootView.FindViewById<ProgressBar> (Resource.Id.progressLH);
linear = rootView.FindViewById<LinearLayout>(Resource.Id.linear_HK_LH);
linearLH = rootView.FindViewById<LinearLayout>(Resource.Id.linearLH);
txtNotify = rootView.FindViewById<TextView>(Resource.Id.txtNotify_LT_HK);
// radioGroup = rootView.FindViewById<RadioGroup>(Resource.Id.radioGroup1);
bundle=this.Arguments;
check = bundle.GetBoolean ("Remind");
autoupdate = bundle.GetBoolean ("AutoUpdateData");
//load data
LoadData_HK ();
// row click
listView_HK.ItemLongClick += listView_ItemClick;
return rootView;
}
示例4: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
if (container == null) {
// Currently in a layout without a container, so no reason to create our view.
return null;
}
var view = inflater.Inflate(Resource.Layout.speaker_screen, container, false);
var speaker = EvolveData.SpeakerData [ShownSpeakerIndex];
headshotImageView = view.FindViewById<ImageView> (Resource.Id.headshotImageView);
var headshot = GetHeadShot (speaker.HeadshotUrl);
headshotImageView.SetImageDrawable (headshot);
speakerNameTextView = view.FindViewById<TextView> (Resource.Id.speakerNameTextView);
speakerNameTextView.Text = speaker.Name;
companyNameTextView = view.FindViewById<TextView> (Resource.Id.companyNameTextView);
companyNameTextView.Text = speaker.Company;
twitterHandleView = view.FindViewById<TextView> (Resource.Id.twitterTextView);
twitterHandleView.Text = "@" + speaker.TwitterHandle;
return view;
}
示例5: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Use this to return your custom view for this Fragment
var view = inflater.Inflate(Resource.Layout.HeaderFragmentLayout, container, false);
var homeBtn = view.FindViewById<ImageView>(Resource.Id.HeaderLogo);
var overlayBtn = view.FindViewById<ImageView>(Resource.Id.HeaderOverlay);
var animIn = AnimationUtils.LoadAnimation(Activity.BaseContext, Resource.Animation.Overlay_animIn);
homeBtn.Click += delegate
{
if (!(Activity is MainActivity))
{
var i = new Intent(Activity, typeof(MainActivity));
i.AddFlags(ActivityFlags.NewTask | ActivityFlags.ClearTop);
Activity.StartActivity(i);
}
};
overlayBtn.Click += delegate
{
overlay.View.StartAnimation(animIn);
overlay.Initialize();
overlay.View.Visibility = ViewStates.Visible;
};
return view;
}
示例6: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
var view = inflater.Inflate(Resource.Layout.BusinessCardFragmentLayout, container, false);
var listView = view.FindViewById<ListView>(Resource.Id.listViewBusinessCards);
listView.Adapter = new BusinessCardAdapter (this.Activity);
return view;
}
示例7: OnCreateViewHolder
public override RecyclerView.ViewHolder OnCreateViewHolder (ViewGroup parent, int viewType)
{
View v = LayoutInflater.From(parent.Context).Inflate(Resource.Layout.inflator_layout2,parent,false);
var vh = new MyViewHolder2(v);
return vh;
}
示例8: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
// Use this to return your custom view for this Fragment
// return inflater.Inflate(Resource.Layout.YourFragment, container, false);
// Lich hoc theo HK
// var rootView = inflater.Inflate(Resource.Layout.LichHoc_HK, container, false);
// ListView listView = rootView.FindViewById<ListView>(Resource.Id.listLH);
//
// var t= BLichHoc.MakeDataFromXml(SQLite_Android.GetConnection ());
// List<LichHoc> listLH = BLichHoc.GetAll (SQLite_Android.GetConnection ());
// List<chiTietLH> listCT = new List<chiTietLH> ();
// foreach (var item in listLH) {
// listCT.AddRange(BLichHoc.GetCTLH (SQLite_Android.GetConnection (), item.Id));
//
// }
//
//
// LichHocHKAdapter adapter = new LichHocHKAdapter (Activity, listCT);
// listView.Adapter = adapter;
//Theo Tuan
var rootView = inflater.Inflate(Resource.Layout.LichHoc_Tuan, container, false);
listView = rootView.FindViewById<ExpandableListView>(Resource.Id.listLH_Tuan);
progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressLHTuan);
LoadData ();
return rootView;
}
示例9: CustomInfoWindow
public CustomInfoWindow (Context context, ViewGroup viewGroup, List<CustomPin> pins)
{
_context = context;
_viewGroup = viewGroup;
_pins = pins;
}
示例10: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
{
View v = inflater.Inflate (Resource.Layout.WebViewDialog, container, false);
txtTitle = v.FindViewById<TextView> (Resource.Id.txt_dialog_title);
divider = v.FindViewById<View> (Resource.Id.title_divider);
webView = v.FindViewById<WebView> (Resource.Id.dialog_web_view);
if (title == null || title.Length < 1) {
txtTitle.Visibility = divider.Visibility = ViewStates.Gone;
} else {
txtTitle.Text = title;
}
if (url != null && url.Length > 0) {
webView.LoadUrl (url);
}
if (showOkay) {
btnOk.Visibility = ViewStates.Visible;
btnOk.Click += (object sender, EventArgs e) => {
this.Dismiss ();
};
}
return v;
}
示例11: GetView
public override View GetView (Context context, View convertView, ViewGroup parent)
{
var view = new RelativeLayout(context);
var parms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
ViewGroup.LayoutParams.WrapContent);
view.SetMinimumHeight(150);
parms.SetMargins(5, 3, 5, 0);
parms.AddRule(LayoutRules.AlignParentLeft);
_caption = new TextView (context);
SetCaption (Caption);
view.AddView(_caption, parms);
if (!String.IsNullOrWhiteSpace (Indicator)) {
var tparms = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.WrapContent,
ViewGroup.LayoutParams.WrapContent);
tparms.SetMargins(5, 3, 5, 5);
tparms.AddRule(LayoutRules.CenterVertical);
tparms.AddRule(LayoutRules.AlignParentRight);
_text = new TextView (context) {
Text = Indicator,
TextSize = 22f
};
view.AddView(_text, tparms);
}
return view;
}
示例12: GetChildView
public override View GetChildView(int groupPosition, int childPosition, bool isLastChild, View convertView, ViewGroup parent) {
View container = View.Inflate(parent.Context, Resource.Layout.list_item_child, null);
TextView txtGroupName = (TextView)container.FindViewById(Resource.Id.txtExampleName);
ExampleFragment child = (ExampleFragment)this.GetChild(groupPosition, childPosition);
txtGroupName.Text = child.Title();
return container;
}
示例13: GetView
public override Android.Views.View GetView(int position, Android.Views.View convertView, ViewGroup parent)
{
ViewHolder holder;
if (convertView == null)
{
convertView = inflater.Inflate(Resource.Layout.PostItem, parent, false);
holder = new ViewHolder();
holder.avatar = (ImageView)convertView
.FindViewById(Resource.Id.user_photo);
holder.userNick = (TextView)convertView
.FindViewById(Resource.Id.user_nick);
holder.postDate = (TextView)convertView
.FindViewById(Resource.Id.post_date);
holder.postContent = (TextView)convertView
.FindViewById(Resource.Id.post_content);
convertView.SetTag(Resource.String.view_holder_tag, holder);
}
else
{
holder = (ViewHolder)convertView.GetTag(Resource.String.view_holder_tag);
}
Post postAtPosition = posts[position];
holder.postContent.Text = postAtPosition.content;
holder.userNick.Text = postAtPosition.userName;
holder.postDate.Text = HttpUtils.postDateToShowFormat(postAtPosition.updatedAt);
Color backgroundColor = postAtPosition.marked ? context.Resources.GetColor(Resource.Color.post_selected) : context.Resources.GetColor(Resource.Color.post_idle);
convertView.SetBackgroundColor(backgroundColor);
return convertView;
}
示例14: OnCreateView
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
view = inflater.Inflate(Resource.Layout.TeamsFragment, container, false);
if(listTeams.Count == 0) {
//display text that there are currently no events and hide list with events
view.FindViewById(Resource.Id.teamsFragmentListTeams).Visibility = ViewStates.Gone;
} else {
//display list with events and hide the text
view.FindViewById(Resource.Id.teamsFragmentNoTeams).Visibility = ViewStates.Gone;
listView = view.FindViewById<ListView>(Resource.Id.teamsFragmentListTeams);
listView.Adapter = new ListTeamsAdapter(this, listTeams);
listView.ItemClick += OnListItemClick;
}
if(DB_Communicator.getInstance().isAtLeast(VBUser.GetUserFromPreferences().getUserType(), UserType.Coremember)) {
view.FindViewById<LinearLayout>(Resource.Id.teamsFragmentBtnAddLine).Visibility = ViewStates.Visible;
} else {
view.FindViewById<LinearLayout>(Resource.Id.teamsFragmentBtnAddLine).Visibility = ViewStates.Gone;
}
view.FindViewById<Button>(Resource.Id.teamsFragmentBtnAdd).Click += (object sender, EventArgs e) => {
ViewController.getInstance().mainActivity.switchFragment(ViewController.TEAMS_FRAGMENT,
ViewController.ADD_TEAM_FRAGMENT, new AddTeamFragment());
};
return view;
}
示例15: OnCreateView
public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle p2)
{
var v = inflater.Inflate(Resource.Layout.hello_world, container, false);
var tv = v.FindViewById<TextView>(Resource.Id.text);
tv.Text = "This is an instance of MyDialogFragment";
return v;
}