正在使用3.1.3.GA SDK,合金和4.2 Android模擬器和現在用的選項對話框,以顯示我的選項給用戶,我需要從this類型更改其選擇器按鈕,爲我們的設計/主題。如何實現它。選項對話框按鈕UI變化鈦Appcelerator的
0
A
回答
1
你必須自己來創建它,先看看它會與0.7不透明一個窗口,包含黑色和兩個白色的意見(最好水平),它們中的每一個標籤和另一個視圖或視圖按鈕進行自定義確認,您還可以使用邊框寬度和邊框顏色作爲淺灰色細節。我創建了類似的東西: http://postimg.org/image/6ygh7wi6p/
下面是代碼:
var mainWindow = Titanium.UI.createWindow({
modal: true,
navBarHidden : true,
backgroundImage:"/global/bg-opacity.png_preview_70x50.png"
});
var alertView = Ti.UI.createView({
width: 300,
height: 500,
borderColor : Alloy.CFG.colors.SILVER,
borderWidth : 1,
backgroundColor:"black",
});
var titleLabel = Ti.UI.createLabel({
top: 10,
height : 40,
left:10,
color : "white",
font : Alloy.CFG.fonts.DEFAULT_22_BOLD,
text: "BACK-UP CARE MOBILE"
});
var testWrapper = Ti.UI.createScrollView({
top:55,
widht:Ti.UI.FILL,
height:385,
borderColor : "#181818",
borderWidth : 1
});
alertView.add(testWrapper);
var textLabel = Ti.UI.createLabel({
top : 10,
bottom: 10,
left : 20,
right : 20,
textAlign: "left",
height : Ti.UI.SIZE,
font : Alloy.CFG.fonts.DEFAULT_17,
color : "white",
text : App.localize("FIRST_RUN_MESSAGE")
});
testWrapper.add(textLabel);
var buttonsWrapper = Ti.UI.createView({
top:440,
height:60,
widht:Ti.UI.FILL,
backgroundColor:"#848684"
});
alertView.add(buttonsWrapper);
var continueBtn = Ti.UI.createButton({
title: 'Continue',
top: 5,
width: 140,
height: 50,
left:155
});
buttonsWrapper.add(continueBtn);
var createProfileBtn = Ti.UI.createButton({
title: 'Create Profile',
top: 5,
width: 140,
height: 50,
left:5
});
buttonsWrapper.add(createProfileBtn);
mainWindow.addEventListener("android:back", function(){
});
希望它能幫助。
0
function createAlert(_args) {
//283x170
var alert = Ti.UI.createView({
width:283,
height:170,
visible:false,
backgroundImage:'/images/alert.png'
});
var label = Ti.UI.createLabel({
text:'This is a custom alert box.\n\nAre you sure that you really want to do that?',
width:263,
height:100,
top:10,
textAlign:'center',
color:'#fff',
font:{
fontWeight:'bold',
fontSize:16
}
});
alert.add(label);
var cancel = Ti.UI.createButton({
width:127,
height:42,
bottom:10,
left:10,
title:'Wait a tick ...',
backgroundImage:'/images/cancel.png'
});
cancel.addEventListener('click', function(e) {
alert.hide();
});
alert.add(cancel);
var ok = Ti.UI.createButton({
width:127,
height:42,
bottom:10,
right:10,
title:'Lets do it!',
backgroundImage:'/images/ok.png'
});
ok.addEventListener('click', function(e) {
alert.hide();
});
alert.add(ok);
return alert;
}
相關問題
- 1. jQuery UI的對話框按鈕改變
- 2. 設置選項,選項對話框鈦
- 3. 鈦Appcelerator自定義按鈕
- 4. 如何將jquery ui對話框按鈕變成複選框?
- 5. 鈦:安卓選項按鈕
- 6. jQuery UI的對話框按鈕
- 7. 爲jQuery UI的對話框按鈕
- 8. jquery ui對話框按鈕的問題
- 9. jQuery UI對話框按鈕 - 返回true?
- 10. jquery ui對話框自定義按鈕
- 11. jQuery UI對話框按鈕定位
- 12. UI對話框按鈕隱藏控件
- 13. jQuery UI對話框和按鈕刷新
- 14. 焦點環jQuery UI對話框按鈕
- 15. jQuery UI:對話框按鈕樣式
- 16. 果汁UI:添加按鈕對話框
- 17. 設置jQuery UI對話框按鈕ID?
- 18. 如何初始化jquery ui對話框中的按鈕
- 19. 從變量的jQuery UI對話框按鈕
- 20. appcelerator鈦選項卡組訂單
- 21. 單選按鈕的對話框首選項
- 22. 單選按鈕對話框顯示所選選項
- 23. 如何訪問首選項對話框中的對話框按鈕
- 24. jQuery UI選項卡和對話框
- 25. jQuery UI對話框默認選項
- 26. Photoshop插件選項對話框UI
- 27. Appcelerator鈦Facebook模塊共享對話框不顯示
- 28. 如何在單選按鈕下方顯示JQuery-UI對話框
- 29. 在jquery-ui對話框中檢查單選按鈕
- 30. jQuery UI:按鈕打開對話框/按鈕不會改變狀態
謝謝Mayito。打開一個模式窗口,並把東西也是好的,簡單的想法,但有可能實現與默認的[OptionDialog](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.OptionDialog )來自鈦。 – Guts
我們可以編輯OptionDialog的主題來放置一個複選框,而不是我們想要的單選按鈕和顏色方案。或者這是一個壞主意?對於appcel社區來說,這是相當新穎的。我認爲玩自己的工具可能會減少錯誤,所以,這mayito。 – Guts
你好@Guts從UI的角度,因爲它們是「原生」的警報對話框,從每個每個平臺的AlertDialog不能修改,(這也與Ti.UI.pikers發生),您可以添加或更改的屬性只有在文檔中所描述的:http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.AlertDialog你可以添加按鈕,但你不能改變用戶界面,希望這有助於鏈接。 –