- public void onCreate(Bundle icicle) {
- super.onCreate(icicle);
- setContentView(R.layout.detail);
-
-
- TextView forgot_pswrd = (TextView) findViewById(R.id.textView1);
-
- LinearLayout.LayoutParams llp = new LinearLayout.LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
- llp.setMargins(50, 0, 0, 0); // llp.setMargins(left, top, right, bottom);
-
- int orientation = getResources().getConfiguration().orientation;
-
- if(orientation == Configuration.ORIENTATION_LANDSCAPE){
-
- forgot_pswrd.setLayoutParams(llp);
-
-
- }
- else{
-
-
-
-
- }
-
- }
复制代码 当方向改变时,怎样调整页边距? |
|