battle programmers alliance

battle programminga forum for elite programmerswith extreme will powerto sharpen theire skills
HomeCalendarFAQSearchMemberlistUsergroupsRegisterLog in

Display results as :
Rechercher Advanced Search
Latest topics
» convert array to xy coodinates
Fri Dec 08, 2017 2:18 pm by Admin

» JS javascript convert number to words
Wed Dec 06, 2017 1:23 pm by Moti Barski

» JS pascal triangle question
Mon Dec 04, 2017 9:54 am by Admin

» youtube emojis
Mon Dec 04, 2017 12:14 am by Admin

» pascal triangle
Sat Dec 02, 2017 10:10 am by Moti Barski

» puzzles at various levels
Sat Dec 02, 2017 8:06 am by Admin

» primitive tech
Fri Dec 01, 2017 8:02 pm by Admin

» course templets
Thu Nov 30, 2017 10:14 am by Moti Barski

» check if two rectangles overlap
Fri Nov 24, 2017 7:36 pm by Moti Barski

December 2017
Social bookmarking
Social bookmarking digg  Social bookmarking delicious  Social bookmarking reddit  Social bookmarking stumbleupon  Social bookmarking slashdot  Social bookmarking yahoo  Social bookmarking google  Social bookmarking blogmarks  Social bookmarking live      

Bookmark and share the address of battle programmers alliance on your social bookmarking website
Share | 

 xamarin c# changing the app background image

View previous topic View next topic Go down 
Moti Barski


Posts : 102
Join date : 2011-08-02

PostSubject: xamarin c# changing the app background image   Sat Oct 07, 2017 3:23 pm

in the solution explorer (right side window), rightclick copy mainActivity.cs, right click paste it on
then rename it (new name.cs)
change the declaration to
[Activity(Label = "SecondScreen")]
public class SecondScreen : Activity
you can also change the icon, save all
in the main activity summon the new activity with:
button1.Click += delegate { StartActivity(typeof(SecondScreen)); };

2.2 manipulating the newly added activity UserInterface technique :
in the layout folder add SecondScreen.axml (in my case SecondScreen.axml) by copypasting the main.axml
add SetContentView(Resource.Layout.SecondScreen);
here is how my code looks like now :
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace App15
    [Activity(Label = "SecondScreen")]
    public class SecondScreen : Activity
        int count = 1;

        protected override void OnCreate(Bundle bundle)

            // Set our view from the "main" layout resource

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

            button.Click += delegate { button.Text = string.Format("{0} clicks!", count++); };
set the second screen.xaml background image to one you add to the resources drawable
now the SecondScreen.axml is the UI of the SecondScreen.cs you added bwahaha !
Back to top Go down
View user profile
xamarin c# changing the app background image
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
» Fully Resizeable Background Image?[PunBB]
» Req background image effect
» Custom Pagination
» Tiling image behind banner on PhpBB?
» BMP, JPG, PNG, GIF, ICO - verify image property.

Permissions in this forum:You cannot reply to topics in this forum
battle programmers alliance :: battle programming alliance :: battle programming-
Jump to: