我对iOS SDK比较陌生,而且我正在遇到一个关于我正在处理的应用程序的设备键盘位置和方向的一个非常奇怪的问题.问题是,如果在用户多任务或应用程序进入后台时键盘处于打开状态,则在用户返回应用程序后,键盘将被移位(UIKeyboardWillChangeFrameNotification被抬起),但方向和位置不正确.
有时键盘也会完全脱离屏幕,这是完全不受欢迎的行为.
我的问题是:
键盘的位置和方向取决于什么?它是如何由iOS控制的?
有没有办法检测键盘何时在屏幕外显示,无论设备类型和屏幕尺寸如何?我认为跟踪UIKeyboardWillChangeFrameNotification或者是可行的UIKeyboardWillShowNotification.
如何在显示键盘之前重置/设置键盘的位置和方向?这甚至可能吗?
我在标签栏控制器之前有一个页面(比如说X),它使用模型segue来打开标签栏控制器.标签栏控制器的第一个屏幕与X相同.
我想将数据从X传递到标签栏控制器的第一页.
不久,我想通过storyboard segue将数据从视图控制器传递到标签栏控制器页面.这有什么方法吗?
这是解决方案;
locationsHome* vc = [[locationsHome alloc] init];
UITabBarController* tbc = [segue destinationViewController];
vc = (locationsHome *)[[tbc customizableViewControllers] objectAtIndex:0];
Run Code Online (Sandbox Code Playgroud) 绘制线条列表时遇到问题。指数发挥作用吗?如果他们这样做,他们在索引缓冲区中的顺序是什么?
我在网上找不到可靠的例子。
<?xml version="1.0" encoding="utf-8"?>
<objectAnimator xmlns:android="http://schemas.android.com/apk/res/android"
android:propertyName="rotationX"
android:valueFrom="0"
android:valueTo="-360"
android:repeatCount="infinite">
</objectAnimator>
Run Code Online (Sandbox Code Playgroud)
这是我的对象动画师 xml
//Animating the NormalLayout
final ObjectAnimator anim4 = (ObjectAnimator) //Object animator
AnimatorInflater.loadAnimator(this, R.animator.rotate_four);
//And this is my java code
Run Code Online (Sandbox Code Playgroud)
我想在循环之间添加延迟,例如再次循环之间间隔 3 秒。我尝试过动画监听器之类的东西onRepeat,onEnd但没有成功。我想要循环之间有一些延迟。
任何帮助将不胜感激。
我有一台Alcatel One Touch 7040,当我测试我的osmdroid样本时,地图不会渲染.我已经在其他设备上进行了测试,地图正确地渲染,只有在这个设备上它们不是.我以为我的设备内存很低,所以我从我的设备中删除了一些应用程序,仍然没有任何改进,有人可以告诉我可能是什么原因?
以下是我的logcat(由于超出了字数限制,它的某些部分已被删除):
10-17 23:03:27.688 26424-26424/marine.com.osmsample I/OsmDroid: Using tile source: Mapnik
10-17 23:03:27.702 26424-26424/marine.com.osmsample E/OsmDroid: unable to create a nomedia file. downloaded tiles may be visible to the gallery. open failed: ENOENT (No such file or directory)
10-17 23:03:27.715 26424-26424/marine.com.osmsample E/SQLiteLog: (14) cannot open file at line 30202 of [00bb9c9ce4]
10-17 23:03:27.715 26424-26424/marine.com.osmsample E/SQLiteLog: (14) os_unix.c:30202: (2) open(/storage/sdcard0/osmdroid/tiles/cache.db) -
10-17 23:03:27.729 26424-26424/marine.com.osmsample E/SQLiteDatabase: Failed to open database '/storage/sdcard0/osmdroid/tiles/cache.db'.
android.database.sqlite.SQLiteCantOpenDatabaseException: unknown error (code 14): Could not open database
at …Run Code Online (Sandbox Code Playgroud) 我在UICollectionView Cell中有一个UIImageView,我想让它的顶角变圆.我无法解决,任何帮助都表示赞赏.
你可以看到单元格有10px的角半径,我也希望在图像上应用相同的效果.
我有一个位于屏幕底部的textField.当我开始编辑时,键盘出现并隐藏textField.
谁能建议如何解决这个问题?
我有这个代码:
JMenuController *menuController = [[JMenuController alloc] init];
NSArray *buttonsArray = [NSArray arrayWithObjects:@"From Libary", @"Take Photo or Video", nil];
[menuController showMenuWithTitle:@"Add Media" ButtonTitles:buttonsArray animated:YES];
self.currentMenuType = JCreateMenuTypeNewMedia;
[[[[UIApplication sharedApplication] delegate] window] addSubview:menuController];
Run Code Online (Sandbox Code Playgroud)
问题是,视图显示在键盘下方,该键盘已在屏幕上.我该如何解决?
我正在使用本教程中的代码来裁剪图像
Intent intent = new Intent(Intent.ACTION_GET_CONTENT, null);
intent.setType("image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", aspectX);
intent.putExtra("aspectY", aspectY);
intent.putExtra("outputX", outputX);
intent.putExtra("outputY", outputY);
intent.putExtra("scale", scale);
intent.putExtra("return-data", return_data);
intent.putExtra(MediaStore.EXTRA_OUTPUT, getTempUri());
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
Run Code Online (Sandbox Code Playgroud)
但我想修改三角形(用于确定要裁剪的区域)的纵横比,使x轴更长y轴
iphone ×4
android ×3
ios ×3
animator ×1
button ×1
indices ×1
ipad ×1
java ×1
lines ×1
objective-c ×1
opengl ×1
osmdroid ×1
storyboard ×1
swift ×1
swift4 ×1
uiimageview ×1
uikeyboard ×1
uitextfield ×1
xcode ×1