• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# LinearLayout类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中LinearLayout的典型用法代码示例。如果您正苦于以下问题:C# LinearLayout类的具体用法?C# LinearLayout怎么用?C# LinearLayout使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LinearLayout类属于命名空间,在下文中一共展示了LinearLayout类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: OnElementChanged

        protected override void OnElementChanged(ElementChangedEventArgs<Page> e) {

            base.OnElementChanged(e);
            myAMapPage = e.NewElement as TencentMapPage;
            layout1 = new LinearLayout(this.Context);
            this.AddView(layout1);

            mapView = new MapView(this.Context) {                
                LayoutParameters = new LinearLayout.LayoutParams(ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.MatchParent)
            };            
            LatLng SHANGHAI = new LatLng( 31.238068,  121.501654);            
            mapView.Map.SetCenter(SHANGHAI);

            var pins = myAMapPage.Pins;

            Drawable d = Resources.GetDrawable(Resource.Drawable.red_location);
            Bitmap bitmap = ((BitmapDrawable)d).Bitmap;
            LatLng latLng1;
            foreach (UserTaskEntInfo pin in pins) {
                latLng1 = new LatLng(pin.Longitude ?? 31.238068, pin.Latitude ?? 121.501654);                
                var markOption = new MarkerOptions();
                markOption.InvokeIcon(new BitmapDescriptor(bitmap));
                markOption.InvokeTitle(pin.Name);
                markOption.InvokePosition(latLng1);
                var fix = mapView.Map.AddMarker(markOption);
                fix.ShowInfoWindow();
            }
            mapView.Map.SetZoom(15); 
            mapView.OnCreate(bundle);
            layout1.AddView(mapView);

        }
开发者ID:Joetangfb,项目名称:Xamarin.Forms_TencentMap,代码行数:32,代码来源:CustomTencentMapRenderer.cs


示例2: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.FeedbackFragment, container, false);
            feedbackPositiveButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackPositiveButton);
            feedbackNeutralButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNeutralButton);
            feedbackNegativeButton = view.FindViewById<ImageButton> (Resource.Id.FeedbackNegativeButton);

            feedbackPositiveButton.Click += (sender, e) => SetRating (ratingPositive);
            feedbackNeutralButton.Click += (sender, e) => SetRating (ratingNeutral);
            feedbackNegativeButton.Click += (sender, e) => SetRating (ratingNegative);

            feedbackMessageEditText = view.FindViewById<EditText> (Resource.Id.FeedbackMessageText).SetFont (Font.Roboto);
            feedbackMessageEditText.AfterTextChanged += OnEdit;

            submitFeedbackButton = view.FindViewById<Button> (Resource.Id.SendFeedbackButton).SetFont (Font.Roboto);
            submitFeedbackButton.Click += OnSendClick;

            feedbackContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackContainer);
            disclaimerContainer = view.FindViewById<LinearLayout> (Resource.Id.FeedbackDisclaimer);
            noUserRegisterButton = view.FindViewById<Button> (Resource.Id.FeedbackRegisterButton);

            bool offline = ServiceContainer.Resolve<AuthManager> ().OfflineMode;
            disclaimerContainer.Visibility = offline ? ViewStates.Visible : ViewStates.Gone;
            feedbackContainer.Visibility = offline ? ViewStates.Gone : ViewStates.Visible;

            noUserRegisterButton.Click += OpenRegisterScreen;

            SetRating (userRating);

            return view;
        }
开发者ID:eatskolnikov,项目名称:mobile,代码行数:31,代码来源:FeedbackFragment.cs


示例3: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            var layout = new LinearLayout(this) {
                Orientation = Orientation.Vertical
            };
            this.AddContentView(layout, new ViewGroup.LayoutParams(-1, -1));

            this.T1 = new TextView(this);
            this.T2 = new TextView(this) {
                Text = DateTime.Now.ToString("yyyy/MM/dd HH:mm:ss")
            };

            layout.AddView(this.T1);
            layout.AddView(this.T2);

            var btn = new Button(this) {
                Text = "Search"
            };

            btn.Click += Btn_Click;
            layout.AddView(btn);

            this.HandleIntent(this.Intent);
        }
开发者ID:gruan01,项目名称:Xamarin-Example,代码行数:26,代码来源:SearchActivity.cs


示例4: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);
            RequestWindowFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.passcode_main);

            _listener = new MessageListener(ACTION_SHAKE, ACTION_DISMISS);
            _listener.MessageReceived += HandleMessageReceived;
            _numbersEntered = 0;

            InitButtons();
            _selectedLayout = FindViewById<LinearLayout>(Resource.Id.passcode_toplayout);

            if(Intent != null)
            {
                bool showCancel = Intent.GetBooleanExtra(EXTRA_SHOW_CANCEL, false);
                _cancelButton.Visibility = showCancel ? ViewStates.Visible : ViewStates.Invisible;

                _passcodeLength = Intent.GetIntExtra(EXTRA_LENGTH, 4);
                _animationIn = Intent.GetIntExtra(EXTRA_IN_ANIMATION, 0);
                _animationOut = Intent.GetIntExtra(EXTRA_OUT_ANIMATION, 0);
            }

            HideUnusedCircles();

            _passcodeEntered = new int[_passcodeLength];
            _shakeAnimation = AnimationUtils.LoadAnimation(this, Resource.Animation.passcode_shake);
        }
开发者ID:edub9,项目名称:XamarinPasscode,代码行数:28,代码来源:PasscodeActivity.cs


示例5: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            ViewGroup rootView = (ViewGroup)inflater.Inflate(Resource.Layout.fragment_calendar_events_read, container, false);
            settingsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.go_settings_layout);
            readEventsLayout = (LinearLayout)rootView.FindViewById(Resource.Id.read_events_layout);

            RadCalendarView calendarView = new RadCalendarView(Activity);

            adapter = new EventReadAdapter(calendarView);
            calendarView.EventAdapter = adapter;

            Button settingsButton = (Button)rootView.FindViewById(Resource.Id.go_settings_button);
            settingsButton.Click += (object sender, EventArgs e) => {
                GoToSettings();
            };

            Button readEventsButton = (Button)rootView.FindViewById(Resource.Id.read_events_button);
            readEventsButton.Click += (object sender, EventArgs e) => {
                TryReadEvents();
            };
            InitLayoutVisibility();
            rootView.AddView(calendarView);

            return rootView;
        }
开发者ID:harith1997,项目名称:Android-samples,代码行数:25,代码来源:ReadEventsFragment.cs


示例6: OnCreateView

        public override View OnCreateView (LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            var view = inflater.Inflate (Resource.Layout.ProjectListFragment, container, false);

            recyclerView = view.FindViewById<RecyclerView> (Resource.Id.ProjectListRecyclerView);
            recyclerView.SetLayoutManager (new LinearLayoutManager (Activity));
            recyclerView.AddItemDecoration (new ShadowItemDecoration (Activity));
            recyclerView.AddItemDecoration (new DividerItemDecoration (Activity, DividerItemDecoration.VerticalList));

            emptyStateLayout = view.FindViewById<LinearLayout> (Resource.Id.ProjectListEmptyState);
            searchEmptyState = view.FindViewById<LinearLayout> (Resource.Id.ProjectListSearchEmptyState);
            tabLayout = view.FindViewById<TabLayout> (Resource.Id.WorkspaceTabLayout);
            newProjectFab = view.FindViewById<AddProjectFab> (Resource.Id.AddNewProjectFAB);
            toolBar = view.FindViewById<Toolbar> (Resource.Id.ProjectListToolbar);

            var activity = (Activity)Activity;
            activity.SetSupportActionBar (toolBar);
            activity.SupportActionBar.SetDisplayHomeAsUpEnabled (true);
            activity.SupportActionBar.SetTitle (Resource.String.ChooseTimeEntryProjectDialogTitle);

            HasOptionsMenu = true;
            newProjectFab.Click += OnNewProjectFabClick;
            tabLayout.SetOnTabSelectedListener (this);

            return view;
        }
开发者ID:alfonsogarciacaro,项目名称:mobile,代码行数:26,代码来源:ProjectListFragment.cs


示例7: OnCreate

		protected override void OnCreate(Bundle bundle)
		{
			base.OnCreate(bundle);

			LinearLayout rootLayout = new LinearLayout(this) {
				Orientation = Orientation.Vertical
			};

			// TODO: Demo2 - Step 2 - Start the service
//			Button startButton = new Button(this) {
//				Text = "Start the Service",
//				LayoutParameters = new LinearLayout.LayoutParams(
//					ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent),
//			};
//			rootLayout.AddView(startButton);
//
//			startButton.Click += delegate {
//				StartService(new Intent(this, typeof(TheService)));
//			};

			// TODO: Demo2 - Step 4a - Request the service stop
//			Button stopButton = new Button(this) {
//				Text = "Stop the Service",
//				LayoutParameters = new LinearLayout.LayoutParams(
//					ViewGroup.LayoutParams.MatchParent, ViewGroup.LayoutParams.WrapContent),
//			};
//			rootLayout.AddView(stopButton);
//
//			stopButton.Click += delegate {
//				StopService(new Intent(this, typeof(TheService)));
//			};

			SetContentView(rootLayout);
		}
开发者ID:flolovebit,项目名称:xamarin-evolve-2014,代码行数:34,代码来源:MainActivity.cs


示例8: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            base.OnCreateView(inflater, container, savedInstanceState);
            var view = inflater.Inflate(Resource.Layout.fragment_profile, null);

            ratingCircle = view.FindViewById<RatingCircle>(Resource.Id.rating_circle);
            circleImage = view.FindViewById<CircleImageView>(Resource.Id.profile_image);


            viewModel = new ProfileViewModel();
            Square.Picasso.Picasso.With(Activity).Load(Settings.Current.UserProfileUrl).Into(circleImage);

            trips = view.FindViewById<TextView>(Resource.Id.text_trips);
            time = view.FindViewById<TextView>(Resource.Id.text_time);
            distance = view.FindViewById<TextView>(Resource.Id.text_distance);
            maxSpeed = view.FindViewById<TextView>(Resource.Id.text_max_speed);
            fuelUsed = view.FindViewById<TextView>(Resource.Id.text_fuel_consumption);
            accelerations = view.FindViewById<TextView>(Resource.Id.text_hard_accelerations);
            stops = view.FindViewById<TextView>(Resource.Id.text_hard_breaks);
            profileAll = view.FindViewById<LinearLayout>(Resource.Id.text_profile_all);

            profileGreat = view.FindViewById<TextView>(Resource.Id.text_profile_great);
            profileRating = view.FindViewById<TextView>(Resource.Id.text_profile_rating);
            profileAll.Visibility = ViewStates.Invisible;
            UpdateUI();
            return view;
        }
开发者ID:Azure-Samples,项目名称:MyDriving,代码行数:27,代码来源:FragmentProfile.cs


示例9: ForwardNavigationMenu

        public ForwardNavigationMenu(Context context, IAttributeSet attrs, int defStyle)
            : base(context, attrs, defStyle)
        {
            _mainContainer = new LinearLayout (context);
            _mainContainer.Orientation = Android.Widget.Orientation.Vertical;
            _mainContainer.LayoutParameters = new LayoutParams (LayoutParams.MatchParent, LayoutParams.MatchParent);
            _context = context;

            var dm = Resources.DisplayMetrics;
            textSize = (int)TypedValue.ApplyDimension (ComplexUnitType.Sp, textSize, dm);

            var a = context.ObtainStyledAttributes (attrs, Attrs);

            a = context.ObtainStyledAttributes (attrs, Resource.Styleable.ForwardNavigationMenu);
            contentPadding = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmContentPadding, contentPadding);
            padding = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmPadding, padding);
            paddingLeft = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmPaddingLeft, paddingLeft);
            paddingBottom = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmPaddingBottom, paddingBottom);
            paddingRight = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmPaddingRight, paddingRight);
            paddingTop = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmPaddingTop, paddingTop);

            margin = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmMargin, margin);
            marginRight = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmMarginRight, marginRight);
            marginLeft = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmMarginLeft, marginLeft);
            marginBottom = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmMarginBottom, marginBottom);
            marginTop = a.GetDimensionPixelSize (Resource.Styleable.ForwardNavigationMenu_fnmMarginTop, marginTop);

            typefaceStyle = (TypefaceStyle)a.GetInt (Resource.Styleable.ForwardNavigationMenu_fnmTextStyle, (int)TypefaceStyle.Normal);
            textAlpha = a.GetInt (Resource.Styleable.ForwardNavigationMenu_fnmTextAlpha, textAlpha);
            a.Recycle ();

            _mainContainer.SetPadding (contentPadding, contentPadding, contentPadding, contentPadding);
            AddView (_mainContainer);
        }
开发者ID:Nininea,项目名称:ForwardNavigationMenu,代码行数:34,代码来源:ForwardNavigationMenu.cs


示例10: OnCreate

        protected override void OnCreate (Bundle savedInstanceState)
        {
            base.OnCreate (savedInstanceState);
            SetContentView (Resource.Layout.AddPhotoPopUpLayout);

            optionalCaption = (EditText)FindViewById (Resource.Id.photoPopupDescription);
            optionalCaption.Enabled = !Assignment.IsHistory;
            dateTime = (TextView)FindViewById (Resource.Id.photoDateTime);
            photoCount = (TextView)FindViewById (Resource.Id.photoCountText);

            deletePhoto = (LinearLayout)FindViewById (Resource.Id.photoDeleteImage);
            deletePhoto.Enabled = !Assignment.IsHistory;
            deletePhoto.Click += (sender, e) => DeletePhoto ();

            var nextPhoto = (ImageButton)FindViewById (Resource.Id.photoNextButton);
            var previousPhoto = (ImageButton)FindViewById (Resource.Id.photoPreviousButton);

            var cancel = (Button)FindViewById (Resource.Id.photoCancelImage);
            cancel.Click += (sender, e) => Dismiss ();

            var done = (Button)FindViewById (Resource.Id.photoDoneImage);
            done.Click += (sender, e) => SavePhoto ();

            photo = (ImageView)FindViewById (Resource.Id.photoImageSource);

            nextPhoto.Visibility =
                previousPhoto.Visibility =
                photoCount.Visibility = ViewStates.Invisible;
        }
开发者ID:EminosoftCorp,项目名称:prebuilt-apps,代码行数:29,代码来源:PhotoDialog.cs


示例11: Initialize

		void Initialize ()
		{
			this.LayoutParameters = new RelativeLayout.LayoutParams(-1,-1);
			this.SetGravity(GravityFlags.CenterHorizontal);

			mainLinearLayout = new LinearLayout (context);
			mainLinearLayout.LayoutParameters = new LinearLayout.LayoutParams (-1, -1);
			mainLinearLayout.Orientation = Orientation.Vertical;

			imBack = new ImageView (context);
			txtDescription = new TextView (context);
			txtTitle = new TextView (context);

			txtTitle.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(38));
			txtDescription.SetTextSize (ComplexUnitType.Fraction, Configuration.getHeight(32));
			txtTitle.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");
			txtDescription.Typeface =  Typeface.CreateFromAsset(context.Assets, "fonts/ArcherMediumPro.otf");


			int padW = Configuration.getWidth(30);
			int padH = Configuration.getHeight (0);
			this.SetPadding (padW,padH,padW,padH);
	
			mainLinearLayout.AddView (txtTitle);
			mainLinearLayout.AddView (imBack);
			mainLinearLayout.AddView (txtDescription);

			this.AddView (mainLinearLayout);
			//this.AddView (background);


		}
开发者ID:aocsa,项目名称:CInca,代码行数:32,代码来源:CustomerImageView.cs


示例12: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate (bundle);

            RequestWindowFeature (WindowFeatures.ActionBarOverlay);
            ActionBar.SetBackgroundDrawable (new ColorDrawable (Color.Transparent));
            SetContentView (Resource.Layout.Main);

            var list = FindViewById<OverscrollListView> (Resource.Id.listView1);
            loadingBars = FindViewById<LinearLayout> (Resource.Id.loadingBars);
            bar1 = FindViewById<ProgressBar> (Resource.Id.loadingBar1);
            bar2 = FindViewById<ProgressBar> (Resource.Id.loadingBar2);
            swipeText = FindViewById<TextView> (Resource.Id.swipeToRefreshText);

            // Remove progress bar background
            foreach (var p in new[] { bar1, bar2 }) {
                var layer = p.ProgressDrawable as LayerDrawable;
                if (layer != null)
                    layer.SetDrawableByLayerId (Android.Resource.Id.Background,
                                                new ColorDrawable (Color.Transparent));
            }

            list.OverScrolled += deltaY => {
                ShowSwipeDown ();

                accumulatedDeltaY += -deltaY;
                bar1.Progress = bar2.Progress = accumulatedDeltaY;
                if (accumulatedDeltaY == 0)
                    HideSwipeDown ();
            };
            list.OverScrollCanceled += HideSwipeDown;
        }
开发者ID:penpan85,项目名称:SwipeDownToRefresh,代码行数:32,代码来源:MainActivity.cs


示例13: Login

        public override void Login(LoginConfig config)
        {
            var context = Utils.GetActivityContext();
            var txtUser = new EditText(context) {
                Hint = config.LoginPlaceholder,
                Text = config.LoginValue ?? String.Empty
            };
            var txtPass = new EditText(context) {
                Hint = config.PasswordPlaceholder,
                TransformationMethod = PasswordTransformationMethod.Instance
            };
            var layout = new LinearLayout(context) {
                Orientation = Orientation.Vertical
            };
            layout.AddView(txtUser, ViewGroup.LayoutParams.MatchParent);
            layout.AddView(txtPass, ViewGroup.LayoutParams.MatchParent);

            Utils.RequestMainThread(() =>
                new AlertDialog
                    .Builder(Utils.GetActivityContext())
                    .SetTitle(config.Title)
                    .SetMessage(config.Message)
                    .SetView(layout)
                    .SetPositiveButton(config.OkText, (o, e) =>
                        config.OnResult(new LoginResult(txtUser.Text, txtPass.Text, true))
                    )
                    .SetNegativeButton(config.CancelText, (o, e) =>
                        config.OnResult(new LoginResult(txtUser.Text, txtPass.Text, false))
                    )
                    .Show()
            );
        }
开发者ID:johnslaby,项目名称:acrmvvmcross,代码行数:32,代码来源:DroidUserDialogService.cs


示例14: NavToolbarFragment

 public NavToolbarFragment( ) : base( )
 {
     BackButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context );
     ShareButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context );
     CreateButton = new Button( Rock.Mobile.PlatformSpecific.Android.Core.Context );
     ButtonLayout = new LinearLayout( Rock.Mobile.PlatformSpecific.Android.Core.Context );
 }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:7,代码来源:NavToolbar.cs


示例15: OnCreateDialogView

        protected override View OnCreateDialogView()
        {
            var layout = new LinearLayout(_context) {Orientation = Orientation.Vertical};
            layout.SetPadding(10, 10, 10, 10);
            layout.SetBackgroundColor(Color.Black);

            _serverUrl = new TextView(_context) {Text = "Server url:"};
            _serverUrl.SetTextColor(Color.White);
            _serverUrl.SetPadding(0, 8, 0, 3);

            _serverUrlBox = new EditText(_context);
            _serverUrlBox.SetSingleLine(true);

            _userKey = new TextView(_context) {Text = "User key:"};
            _userKey.SetTextColor(Color.White);

            _userKeyBox = new EditText(_context);
            _userKeyBox.SetSingleLine(true);

            layout.AddView(_serverUrl);
            layout.AddView(_serverUrlBox);
            layout.AddView(_userKey);
            layout.AddView(_userKeyBox);

            return layout; 
        }
开发者ID:Smeedee,项目名称:Smeedee-Mobile,代码行数:26,代码来源:GlobalSettingsScreen.cs


示例16: AddSpinner

        public void AddSpinner(ViewGroup rootview,string loadingtext)
        {
            loading = true;
            if(loadingcontainer==null||(loadingcontainer!=null&&!loadingcontainer.IsShown)){
                loadingcontainer = new RelativeLayout (nn_activity);
                loadingcontainer.LayoutParameters = new RelativeLayout.LayoutParams (RelativeLayout.LayoutParams.MatchParent, RelativeLayout.LayoutParams.MatchParent);
                loadingcontainer.SetBackgroundColor (Color.White);

                var detailcontainer = new LinearLayout (nn_activity);

                detailcontainer.Orientation = Orientation.Vertical;
                RelativeLayout.LayoutParams param = new RelativeLayout.LayoutParams ((int)TapUtil.dptodx (100), RelativeLayout.LayoutParams.WrapContent);
                param.AddRule (LayoutRules.CenterInParent);
                detailcontainer.LayoutParameters = param;

                LinearLayout.LayoutParams linearlayoutparm = new LinearLayout.LayoutParams (LinearLayout.LayoutParams.MatchParent, LinearLayout.LayoutParams.WrapContent);
                linearlayoutparm.Gravity = GravityFlags.CenterHorizontal;

                ProgressBar progressbar = new ProgressBar (nn_activity);
                progressbar.LayoutParameters = linearlayoutparm;

                TextView tectview = new TextView (nn_activity);
                tectview.LayoutParameters = linearlayoutparm;
                tectview.Text = loadingtext;
                tectview.Gravity = GravityFlags.CenterHorizontal;

                detailcontainer.AddView (progressbar);
                detailcontainer.AddView (tectview);

                loadingcontainer.AddView (detailcontainer);
                rootview.AddView (loadingcontainer);
            }
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:33,代码来源:Tap5050Fragment.cs


示例17: OnCreate

        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);

            _layout = new LinearLayout(this);

            // Get our button from the layout resource,
            // and attach an event to it
            Button btnClickMe = FindViewById<Button>(Resource.Id.btnClickMe);

            //button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
            btnClickMe.Click += new EventHandler(button_Click);

            Button btnClear = FindViewById<Button>(Resource.Id.btnClear);
            btnClear.Click += new EventHandler(btnClear_Click);

            Button btnShowSecond = FindViewById<Button>(Resource.Id.btnShowSecond);
            //btnShowSecond.Click += (sender, e) => { StartActivity(typeof(SecondActivity)); };
            btnShowSecond.Click += (sender, e) =>
            {
                var second = new Intent(this, typeof(SecondActivity));
                second.PutExtra("FirstData", "Data from First Activity");
                StartActivity(second);
            };

            Button btnTabbed = FindViewById<Button>(Resource.Id.btnTabbedPage);
            btnTabbed.Click += (sender, e) =>
            {
                StartActivity(typeof(TabbedActivity));
            };
        }
开发者ID:armaduk,项目名称:Stacks,代码行数:34,代码来源:FirstActivity.cs


示例18: OnCreateView

        public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
        {
            rootview = (RelativeLayout)inflater.Inflate (Resource.Layout.raffleroot, container, false);
            locationcontainerlayout=(LinearLayout)rootview.FindViewById (Resource.Id.raffleroot_locationcontainer_linerlayout);

            TextView locationtext=new TextView(nn_activity);
            locationtext.Text=nn_location;
            LinearLayout.LayoutParams param=new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WrapContent,LinearLayout.LayoutParams.WrapContent);
            param.Gravity=global::Android.Views.GravityFlags.Center;
            param.LeftMargin=TapUtil.dptodx(5);
            locationtext.LayoutParameters=param;
            locationcontainerlayout.AddView (locationtext);

            //initialize listview
            listview=(ListView)rootview.FindViewById(Resource.Id.raffleroot_eventlist_listview);
            listview.Divider = null;
            adapter = new EventListAdapter (nn_activity,eventcards);
            listview.Adapter = adapter;
            //adapter.NotifyListChange ();

            listview.ItemClick+= (object sender, AdapterView.ItemClickEventArgs e) => {
                (nn_activity as HomeScreen).ShowRaffleDetailFragment(e.Position);

            };

            return rootview;
        }
开发者ID:MADMUC,项目名称:TAP5050,代码行数:27,代码来源:RaffleRootFragment.cs


示例19: OnElementChanged

        protected override void OnElementChanged(ElementChangedEventArgs<Page> e)
        {
            base.OnElementChanged(e);

            var actionBar = ((Activity)Context).ActionBar;
            LinearLayout layout = new LinearLayout(Context);
            layout.Orientation = Orientation.Horizontal;
            layout.WeightSum = Width;
            layout.SetGravity(GravityFlags.Left);
            TextView title = new TextView(Context);
            title.Text = actionBar.Title;

            title.TextSize = 18;
            Typeface font = Typeface.CreateFromAsset(Forms.Context.Assets, "BTrafcBd.ttf");
            title.Typeface = font;

            LayoutParams textlp = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);

            ImageView logo = new ImageView(Context);

            logo.Clickable = true;
            logo.Click += Logo_Click;

            logo.SetImageResource(Resource.Drawable.Logo);
            logo.SetScaleType(ImageView.ScaleType.FitStart);
            layout.AddView(logo);
            actionBar.SetCustomView(layout, new ActionBar.LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent));
            actionBar.SetDisplayOptions(ActionBarDisplayOptions.ShowCustom, ActionBarDisplayOptions.ShowCustom);
        }
开发者ID:mxmaa64,项目名称:Calender,代码行数:29,代码来源:MyMasterDetailPageRenderer.cs


示例20: 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);

			 rootView = inflater.Inflate(Resource.Layout.HocPhi, container, false);

			Bundle bundle=this.Arguments;
			check = bundle.GetBoolean ("Remind");
			autoupdate = bundle.GetBoolean ("AutoUpdateData");

			progress=rootView.FindViewById<ProgressBar>(Resource.Id.progressHP);
			listView = rootView.FindViewById<ListView>(Resource.Id.listHP);
			txtHocKyHP = rootView.FindViewById<TextView>(Resource.Id.txtHocKyHP);
			 txtNotify = rootView.FindViewById<TextView> (Resource.Id.txtNotify_HP);
			linear = rootView.FindViewById<LinearLayout> (Resource.Id.linear10);
			//load data
		
		
			progress.Visibility = ViewStates.Visible;
			progress.Indeterminate = true;
			//progress.Indeterminate = true;
			LoadData ();

			return rootView;
		}
开发者ID:tienbui123,项目名称:Mobile-VS2,代码行数:26,代码来源:HocPhiFragment.cs



注:本文中的LinearLayout类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# LinearLayout.LayoutParams类代码示例发布时间:2022-05-24
下一篇:
C# LinearGradientMode类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap