你好朋友我正在制作Phonegap应用程序(WindowsPhone,Android,IOS,BB7和BB10)我希望NavigationBar可以在一行中包含超过五个导航元素,水平可滚动这是我的导航栏的html代码(导航栏数据)根据用户需要动态调整)
<div id="customize_div_id" style="width:2000px; >
<div onclick="customize_nav_scroll();" data-role="navbar" >
<ul class="customize-item-class" id="customize_item_id">
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
我可以使用此链接创建动态导航栏jQuery Mobile导航栏中每行超过5个项目
但我的问题是只有五个导航项将显示给用户其余部分都是水平滚动的.我无法滚动这些项目我遵循JQuery Docs中提供的一些方法
.scrollLeft( value )
.scrollRight( value )
$.event.special.swipe.start
$.event.special.swipe.stop
$.event.special.swipe.handleSwipe
我也尝试下面的方法有很多可能性但是我没有得到理想的结果
function customize_nav_scroll(){
var step = 1;
var current = 0;
var maximum = $("#customize_div_id div ul li").size();
var visible = 2;
var speed = 500;
var liSize = 120;
var height = 30;
var ulSize = liSize * maximum;
var divSize = liSize * visible;
$("#customize_div_id div").css("width",ulSize+"px");
$("#customize_div_id div …Run Code Online (Sandbox Code Playgroud) 如果重复这个问题,请告诉我原始问题的链接,因为我能找到解决当前问题的好链接.
我正在 phonegap(cordova2.7) camera 为Android 4.2制作应用程序.我可以从我的应用程序中获取多张图片.所有图像都保存在SD卡中.但我想在拍摄照片的顶部写下名字.我能够找到如何解决这个问题.
我想只使用javascript,phonegap方法或plugins.i不需要任何java代码.我尝试使用画布
var CAM = {};
window.n = 0;
CAM.changePicture = function() {
navigator.camera.getPicture(CAM.onPhotoDataSuccess, CAM.onFail, {
quality : 100,
destinationType : Camera.DestinationType.FILE_URI,
sourceType : Camera.PictureSourceType.CAMERA,
encodingType : 0,
saveToPhotoAlbum : true
});
};
CAM.onPhotoDataSuccess = function(imageURI) {
var c=document.createElement('canvas');
var ctx=c.getContext("2d");
ctx.font = "20px arial";
ctx.drawImage(imageURI,10,10);
ctx.fillText("Hello",30,30);
var gotFileEntry = function(fileEntry) {
var gotFileSystem = function(fileSystem) {
alert(3);
fileSystem.root.getDirectory("AndroidClinic11/"
+ CAMFUNC.folderName(), {
create : true
}, function(dataDir) {
n++;
var newFileName = CAMFUNC.folderName() + " …Run Code Online (Sandbox Code Playgroud) 我的下面的代码点击打开相机,拍照,从相机获取照片,然后进入imageview.但是我想拍摄图像并在图像上应用文本(某种时间戳,最好是图像中的时间戳,或者只是系统日期时间)并保存为jpeg.
如果有人能帮助我,那将是非常棒的.
public class PhotoIntentActivity extends Activity {
private static final int ACTION_TAKE_PHOTO_B = 1;
private static final String BITMAP_STORAGE_KEY = "viewbitmap";
private static final String IMAGEVIEW_VISIBILITY_STORAGE_KEY = "imageviewvisibility";
private ImageView mImageView;
private Bitmap mImageBitmap;
private String mCurrentPhotoPath;
private static final String JPEG_FILE_PREFIX = "IMG_";
private static final String JPEG_FILE_SUFFIX = ".jpg";
private AlbumStorageDirFactory mAlbumStorageDirFactory = null;
/* Photo album for this application */
private String getAlbumName() {
return getString(R.string.album_name);
}
private File getAlbumDir() {
File storageDir = null;
if …Run Code Online (Sandbox Code Playgroud)