Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

android studio linearlayout set margin

LinearLayout ll = new LinearLayout(this);
ll.setOrientation(LinearLayout.VERTICAL);

LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
     LinearLayout.LayoutParams.MATCH_PARENT, LinearLayout.LayoutParams.WRAP_CONTENT);

layoutParams.setMargins(30, 20, 30, 0);

Button okButton=new Button(this);
okButton.setText("some text");
ll.addView(okButton, layoutParams);
Comment

PREVIOUS NEXT
Code Example
Java :: floatingactionbutton image color 
Java :: java send an image over a socket 
Java :: convert string to double android studio 
Java :: finally block does not complete normallyJava(536871096) 
Java :: java print stacktrace to file 
Java :: java cast bolean to int 
Java :: gradle build with javadoc 
Java :: JLabel not centering 
Java :: error when making java variable 
Java :: java taking console input 
Java :: How to efficiently count the number of smaller elements to the right of every array element, in Java? 
Java :: vector inline java 
Java :: how to set view width programmatically in android 
Java :: Utils code for plugin minecraft 
Java :: when does lockdown end 
Java :: how to restart activity in android 
Java :: A failure occurred while executing com.android.build.gradle.tasks.ProcessLibraryManifest$ProcessLibWorkAction 
Java :: comment out and uncomment in netbeans java 
Java :: java localdate zoneid example 
Java :: reverse recyclerview android 
Java :: character to lower java 
Java :: check java version 
Java :: best ascii art characters 
Java :: localdate to timestamp in java 
Java :: java split on tab 
Java :: swing enter key 
Java :: how to programitically remove action bar from an activity in android studio 
Java :: how to find the angle of 2 coordinates java 
Java :: how to iterate hashset in java 8 
Java :: dupplicate classes android 
ADD CONTENT
Topic
Content
Source link
Name
4+6 =