|
whiteworm 發表於 Oct 1, 2019 1:47:27 GMT
你好,我想請問一下,關於addRadioGroup這個函數是否可以應用在選項選擇上?
例如,三個地圖為A,B,C 我想套入while裡面 如果選A則會跑A程式、選B則會跑B程式、選C則會跑C程式 但是這個寫法我爬文好像都找不到 似乎都是用checkbox比較多
請問該怎麼寫呢??謝謝指教~~
|
|
|
AnkuLua 發表於 Oct 1, 2019 5:20:45 GMT
dialogInit() addRadioGroup("option", 1) addRadioButton("A", 1) addRadioButton("B", 10) addRadioButton("C", 11) dialogShow("Choose option")
if (option == 1) then print ("A") end if (option == 10) then print ("B") end if (option == 11) then print ("C") end
|
|
|
whiteworm 發表於 Oct 1, 2019 5:37:37 GMT
另請教我看使用者介面函數說明--
Dialog 提供下列元素, TextView, EditText, CheckBox, RadioGroup 和RadioButton. TextView, EditText 和CheckBox 基本都是排成橫的一排 要開始新的一排,請使 newRow() 函數
可是我把三個addRadioButton寫在同一排的時候,他還是會分成三排 dialogInit()--起始一個新的dialog設計
addRadioGroup("map", 1)
addRadioButton("高山", 1) addRadioButton("河流", 2) addRadioButton("草原", 3)
dialogShow("腳本設定") 請問是哪裡有錯嗎?
感謝指正~~
|
|
|
AnkuLua 發表於 Oct 1, 2019 7:27:02 GMT
另請教我看使用者介面函數說明-- Dialog 提供下列元素, TextView, EditText, CheckBox, RadioGroup 和RadioButton. TextView, EditText 和CheckBox 基本都是排成橫的一排 要開始新的一排,請使 newRow() 函數可是我把三個addRadioButton寫在同一排的時候,他還是會分成三排 dialogInit()--起始一個新的dialog設計 addRadioGroup("map", 1) addRadioButton("高山", 1) addRadioButton("河流", 2) addRadioButton("草原", 3) dialogShow("腳本設定") 請問是哪裡有錯嗎? 感謝指正~~ radio group 每一元素占一排,沒錯
|
|