User interface Android:管理因广告而产生的UI高度
在我的Android应用程序中,我为所有活动设置了一个公共页脚 使用最顶级的活动MyActivity这样实现 在我的其他活动中,我的代码为:User interface Android:管理因广告而产生的UI高度,user-interface,android-layout,height,footer,User Interface,Android Layout,Height,Footer,在我的Android应用程序中,我为所有活动设置了一个公共页脚 使用最顶级的活动MyActivity这样实现 在我的其他活动中,我的代码为: public class TestActivity extends MyActivity implements OnClickListener { private static final String TAG = "TEST"; private AlertDialog.Builder builder = null; /** Called when
public class TestActivity extends MyActivity implements OnClickListener {
private static final String TAG = "TEST";
private AlertDialog.Builder builder = null;
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
//setContentView(R.layout.main);
// Pick up the group from head_foot.xml for middle data to be displayed
ViewGroup vg = (ViewGroup) findViewById(R.id.lldata);
ViewGroup.inflate(Mumbai77Activity.this, R.layout.main, vg);
在其他活动中,我通过充气布局和显示创建AlertDialog的MyActivity的子活动中,AlertDialog的高度应小于页脚达到的高度。如何处理AlertDialog的高度
我用于创建对话框的代码是:
public AlertDialog createAlertDialog(String title, String[] items, OnItemClickListener clickListener) {
LayoutInflater layoutInflater = (LayoutInflater)this.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
// scrollview1 is the root of this activiy layout
ViewGroup vg = (ViewGroup) findViewById(R.id.scrollView1);
LinearLayout view = (LinearLayout) layoutInflater.inflate(R.layout.gen_list_layout, vg, false);
<?xml version="1.0" encoding="utf-8"?>
<ScrollView android:layout_height="wrap_content" android:id="@+id/scrollView1"
android:layout_width="fill_parent" xmlns:android="http://schemas.android.com/apk/res/android">
我尝试在AlertDialog中为视图组设置LayoutParams,但也没有成功
如何使AlertDialog的高度与scrollview或lldata的高度相同?此问题无帮助热线或指导!!!!有没有人能帮我解决这个问题。