解决方法
@Yume177,我发现了怎么做:
- @Override
- public void onConfigurationChanged(Configuration newConfig) {
- // TODO Auto-generated method stub
- super.onConfigurationChanged(newConfig);
- RelativeLayout rl = (RelativeLayout) findViewById(R.id.about);
- rl.removeAllViews();
- rl.addView(View.inflate(myView.getContext(),R.layout.about,null));
- }
我有两个名为“about.xml”的RelativeLayout,在dir res / layout-sw720dp / about.xml中有一个布局,我的drawable用于纵向模式,res / layout-sw720dp-land / about.xml用我的landscape drawable.当我旋转平板电脑时,我的布局非常合适.希望我会帮助你