package com.android.layout;
import android.app.Activity;
import android.os.Bundle;
//You can set the orientation of the LinearLayout to LinearLayout.VERTICAL,
//or LinearLayout.HORIZONTAL. If you select VERTICAL, then all your components
//added to this container will be stacked on top of each other. If you pick HORIZONTAL,
//they will all be stacked beside each other.
// This weight determines how much empty space the component should take up in the final layout.
//Before adding a component to this container, you have to set its LinearLayout.LayoutParams.
//This specifies the height and width constraints you want to assign to your component.
//You can specify the “gravity” for each component that’s in the LinearLayout. This determines whether the component
//is left or right aligned, and top or bottom aligned, or a combination of these.
public class HelloLinearLayoutActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
import android.app.Activity;
import android.os.Bundle;
//You can set the orientation of the LinearLayout to LinearLayout.VERTICAL,
//or LinearLayout.HORIZONTAL. If you select VERTICAL, then all your components
//added to this container will be stacked on top of each other. If you pick HORIZONTAL,
//they will all be stacked beside each other.
// This weight determines how much empty space the component should take up in the final layout.
//Before adding a component to this container, you have to set its LinearLayout.LayoutParams.
//This specifies the height and width constraints you want to assign to your component.
//You can specify the “gravity” for each component that’s in the LinearLayout. This determines whether the component
//is left or right aligned, and top or bottom aligned, or a combination of these.
public class HelloLinearLayoutActivity extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}
No comments:
Post a Comment