在我的應用程序中,我使用了一個警報框..在這個警報框中,我給出了另一個顯示佈局..使用setView()
方法..我有一個問題。如何在我的活動中使用佈局元素ID?如何使用其他佈局ID?
LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE);
View layout = inflater.inflate(R.layout.volume, null);
builder.setTitle("Volume");
builder.setView(layout);
builder.setPositiveButton("OK", null);
builder.setNegativeButton("Cancel", null);
AlertDialog alert1 = builder.create();
alert1.show();
闡述您的問題... – waqaslam 2012-03-16 12:50:34
海,在我的應用程序使用量控制搜索條。這應該出現在一個buuton點擊。所以我使用警報box.that警報框有一個卷佈局..我problam是我沒有使用seekbar id .. – Palaniraja 2012-03-16 14:08:41
然後我想你應該在xml佈局中指定一個ID到你的seekbar以便稍後參考它在代碼 – waqaslam 2012-03-16 14:13:23