1. #1
    Touch Premium Member
    Join Date
    Oct 2010
    Posts
    32
    Vote Rating
    1
    kgilb is on a distinguished road

      0  

    Question Center image on toolbar?

    Center image on toolbar?


    I asked this in the premium forum with no replay. I'm sure this is easy, I just can't seem to find any documentation on how to do it:

    How do you center an image on a toolbar? I would like to put our company branding in the center of the toolbar as opposed to some text.

  2. #2
    Sencha User
    Join Date
    Feb 2009
    Location
    Glasgow, Scotland
    Posts
    281
    Vote Rating
    1
    Stoot98 will become famous soon enough

      0  

    Default


    You could use a 'spacer' component, one either side of the image with the image having a flex of 1 too.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    You don't need flex on the middle item

    Code:
    var panel = new Ext.Panel({
    	fullscreen : true,
    	dockedItems : {
    		xtype : "toolbar",
    		dock  : "top",
    		items : [
    			{ xtype : "spacer" },
    			{ xtype : "container", html : "Something here" },
    			{ xtype : "spacer" }
    		]
    	}
    });
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  4. #4
    Sencha User
    Join Date
    Mar 2011
    Location
    Liverpool, UK
    Posts
    20
    Vote Rating
    0
    Sunforever0220 is on a distinguished road

      0  

    Question


    Can anyone tell me how to add the image onto the toolbar before centering it? Thanks

  5. #5
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    35,704
    Vote Rating
    751
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      1  

    Default


    To add an image, just create a Component with the img tag in the html config and place it in the Toolbar items array wherever you want it.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Similar Threads

  1. Set a image in middle and center in a Container
    By minlab in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 24 Sep 2010, 7:37 AM
  2. How to set the image of rowAction to the Center?
    By yagi in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 3 Aug 2010, 12:20 AM
  3. [SOLVED]Can I center an image in a panel?
    By StevenInc in forum Ext 3.x: Help & Discussion
    Replies: 2
    Last Post: 10 Aug 2009, 7:18 PM
  4. How to center the image in ContentPanel?
    By andre_guitar7 in forum Ext 2.x: Help & Discussion
    Replies: 0
    Last Post: 30 Mar 2009, 5:01 AM

Thread Participants: 3

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar