• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

relativelayout.layoutparams not being applied to view

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
cant figure why these params are not being applied buttonp works and the view is in the right place but letp dont seem to do anything the view is small and placed i the top left of the screen not the center and stretched to matchparent cant figure it out anyway here is the code any help would be great thanks..


 
Ranch Hand
Posts: 606
11
Android Python Open BSD VI Editor Slackware
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
why are you pinpointing your button with this?

Button returnbut=new Button(this);



It is not java, if you pass this will be called I am afraid an instance of the Activity!
you need to refer your button with  

findViewById(R.id.NameOfYourButton)


this is how android coders do, also notice that in real life you will see this referenced by mean of  a library called Butterknife
reply
    Bookmark Topic Watch Topic
  • New Topic