2012-05-16 63 views
2

我正在研究包含單選按鈕控件的黑莓應用程序。單選按鈕在黑莓的Horizo​​ntalFieldManager中不可見?

HorizontalFieldManager hr = new HorizontalFieldManager(); 
setTitle("UI Component Sample"); 
RadioButtonGroup rbg = new RadioButtonGroup(); 
RadioButtonField r1 = new RadioButtonField("Option 1",rbg,true); 
RadioButtonField r2 = new RadioButtonField("Option 2",rbg,false); 
hr.add(r1); 
hr.add(r2); 
add(hr); 

與此代碼我可以看到曲線裝置既我的單選按鈕的工作,但是當我安裝我的火炬裝置的應用程序,只有第一個單選按鈕是在屏幕上可見。 在水平字段中顯示一個無線電組遇到問題。 它適用於我爲組使用垂直字段。

而水平和垂直兩個作品,當我在曲線設備上工作。

請建議這是什麼類型的巴士或問題。

We can see only one radio button is visible

enter image description here

+0

得到這個問題解決與偉大的幫助PF RUPAK,這個問題的主要問題是炬力和曲線的設備分辨率。 –

回答

2

在OS 6,RadioButtonField導致關於其寬度一些問題。覆蓋layout(int, int)方法可能會解決您的問題。嘗試下面的代碼。

RadioButtonGroup rbg = new RadioButtonGroup(); 

RadioButtonField rbf = new RadioButtonField("Label", rbg, true) { 
    protected void layout(int width, int height) { 
     super.layout(getPreferredWidth(), height); 
    } 
}; 
+0

Thanxxx很多@Rupak,這類工作只能靠經驗來實現....! –

+0

Hello Rupak,Thanx爲我提供了快速修復,但問題不在於軟件版本,由於設備分辨率的原因導致此無線電按鈕問題,因此在尋呼和曲線圖中存在很大差異。我確認了這一點。:) –

相關問題