回答

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

謝謝Mayito。打開一個模式窗口,並把東西也是好的,簡單的想法,但有可能實現與默認的[OptionDialog](http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.OptionDialog )來自鈦。 – Guts

+0

我們可以編輯OptionDialog的主題來放置一個複選框,而不是我們想要的單選按鈕和顏色方案。或者這是一個壞主意?對於appcel社區來說,這是相當新穎的。我認爲玩自己的工具可能會減少錯誤,所以,這mayito。 – Guts

+0

你好@Guts從UI的角度,因爲它們是「原生」的警報對話框,從每個每個平臺的AlertDialog不能修改,(這也與Ti.UI.pikers發生),您可以添加或更改的屬性只有在文檔中所描述的:http://docs.appcelerator.com/titanium/latest/#!/api/Titanium.UI.AlertDialog你可以添加按鈕,但你不能改變用戶界面,希望這有助於鏈接。 –

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; 

}