해결했습니다.~~~~~~~~~~~~
상단에 버튼들이 클릭해도 반응이 없는데 reflash버튼만 이벤트가 먹습니다. 무슨문제입니까?
function previous() {
if ($.wv_main.canGoBack()) {
$.wv_main.goBack();
}else{
var confirmClear = Titanium.UI.createAlertDialog({
message:'종료하시겠습니까?',
buttonNames: ['확인','취소']
});
confirmClear.show();
confirmClear.addEventListener('click',function(e) {
if (e.index === 0) {
$.index.close();
}
});
}
}
function nextious() {
if ($.wv_main.canGoForward()) {
$.wv_main.goForward();
}
}
$.index.addEventListener('androidback', function(e){
previous();
});
$.menu_right.addEventListener('click',function(e){
nextious();
});
$.menu_left.addEventListener('click',function(e){
previous();
});
$.menu_home.addEventListener('click',function(e){
$.wv_main.url = 'http://lumid.co.kr/index.php?device=mobile'; //경로이동
});
$.menu_reflash.addEventListener('click',function(e){
$.wv_main.reload(); //새로고침
});
$.wv_main.addEventListener('beforeload', function(e){
var url = e.url;
// http://developer.appcelerator.com/question/76861/open-android-market-from-within-an-app
if (url.indexOf('market')!=-1 || url.indexOf('intent')!=-1 || url.indexOf('facebook')!=-1){
Ti.API.info(url);
var intent = Ti.Android.createIntent({
action: Ti.Android.ACTION_VIEW,
data:url
});
$.wv_main.goBack();
Ti.Android.currentActivity.startActivity(intent);
}
});
$.index.open();
<Alloy>
<Window class="container">
<View class="title_bar">
<View class="top_left">
<ImageView class="top_left_img" id="menu_left"></ImageView>
<ImageView class="top_right_img" id="menu_right"></ImageView>
</View>
<ImageView class="top_home_img" id="menu_home" image="/home_off.png"/>
<View class="top_right">
<ImageView class="top_reset_img" id="menu_reflash" ></ImageView>
</View>
</View>
<WebView id="wv_main" class="wv_class" url="http://lumid.co.kr/index.php?device=mobile"/>
</Window>
</Alloy>
".container": {
backgroundColor:"white"
}
".title_bar":{
top : 0,
height : 48,
left : 0,
width : "100%",
backgroundColor : '#FFFFFF'
}
".top_left":{
width : "100",
height: "48",
left:0
}
".wv_class":{
top:48
}
".top_left_img":{
image:"/back_off.png",
left : 5
}
".top_right_img":{
image:"/next_off.png"
}
".top_reset_img":{
image:"/reflash_off.png",
right:5
}