Im noob in framework appcelerator and I have a simple problem in android. I dont know how put the backbutton in ActionBar like this link image
This button does not appear to me. I used heavywindow. android sdk-version 27 SDK Titanium 7.0.0.GA
Im noob in framework appcelerator and I have a simple problem in android. I dont know how put the backbutton in ActionBar like this link image
This button does not appear to me. I used heavywindow. android sdk-version 27 SDK Titanium 7.0.0.GA
You can add Action Bar like this:
<Alloy>
<Window title="Action Bar Title">
<ActionBar platform="android" displayHomeAsUp="true" onHomeIconItemSelected="close"></ActionBar>
</Window>
</Alloy>
You can even add Subtitle, Menu Items, Overflow Menu, icons, & even custom views.
Read more about using Action Bar in Titanium here
For more control over ActionBar for full customizations, Titanium has introduced Toolbar in SDK 6.2.0 - Read about Titanium Android Toolbar here
write this in onCreate
{
getSupportActionBar().setHomeButtonEnabled(true);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
getSupportActionBar().setDisplayShowHomeEnabled(true);
override onOptionsItemSelected method
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()){
case android.R.id.home:
onBackPressed();
break;
}
}
return super.onOptionsItemSelected(item);
}