• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

relativelayout.layoutparams not being applied to view

 
Ranch Hand
Posts: 57
  • 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: 600
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
 
You are HERE! The other map is obviously wrong. Better confirm with this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic