Apple没有提供我应该用于的图像文件大小的清晰列表:
因为我打算使用swift,我只能假设ios7 +这意味着我可以忽略ios5 + 6的所有其他尺寸.那是对的吗?
(也可以使用LaunchScreen.storyboard解决方案,但这有更高的iOS要求,所以现在看起来包括启动图像似乎更好.)
如何解决以正确尺寸创建所有启动图像的问题?
对于那个暂停这个问题的人的注意事项: 我最初询问是否有人知道有规格的清单.显然这就是为什么你在我发布它之后3年后才结束答案的原因.但实质上这个问题是关于Apple API规范的编程问题,可能有精确的答案.这是不求意见为主答案的问题.
例如,这段代码:
if (Build.VERSION.SDK_INT > Build.VERSION_CODES.GINGERBREAD) {
myCalendarView.setOnDateChangeListener(
new OnDateChangeListener() {
@Override
public void onSelectedDayChange(CalendarView view, int year, int month, int dayOfMonth) {
Toast.makeText
(
getApplicationContext(), ""+dayOfMonth, 0
).show();
}
}
);
}
Run Code Online (Sandbox Code Playgroud)
给出错误:
说明资源路径位置类型调用需要API级别11(当前最小值为8):android.widget.CalendarView #setOnDateChangeListener example.java/example/src/com/example/example line 20 Android Lint问题
我理解为什么我在编译时遇到这个错误.但有没有办法将源Java类标记为仅用于某个API级别-11?或者使用定义/类似的环绕代码块,以便代码仅在API级别11以上的设备上进行后期绑定/ jitted?达到我想要的最佳解决方案是什么?(这是为了在设备上提供CalendarView的活动.)
经过很长一段时间没有任何问题的应用程序运行 - 我得到一个报告表单用户说明保存的数据/照片时不时丢失.即它最初可能有效,但在稍后阶段,内容似乎消失了.我不能复制这个问题,所以我试图看看我是否可以"猜测"它.
首先要确保的是,我没有以最近Android版本不可行的方式保存数据.因此,这是我目前如何保存数据:
...
第一次尝试
File storage_files_dir_file = ctx.getExternalFilesDir("");
if (storage_files_dir_file.exists() == false) {
return false;
}
// ... some code here prepping content
os = new FileOutputStream(path_final,true);
// ... some code here writing content
MediaScannerConnection.scanFile(ctx, new String[] {s}, null, null);
return true
Run Code Online (Sandbox Code Playgroud)
如果以上返回false切换到
File storage_files_dir_file = ctx.getFilesDir();
if (storage_files_dir_file.exists() == false) {
return false;
}
// ... some code here prepping content
os = new FileOutputStream(path_final,true);
// ... some code here writing content
return true
Run Code Online (Sandbox Code Playgroud)
...
我的AndroidManifest.xml包括
<uses-permission …Run Code Online (Sandbox Code Playgroud) 我有这个代码:
<ImageView
android:id="@+id/listitem_logo"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
Run Code Online (Sandbox Code Playgroud)
和
imageview_logo.setImageBitmap(bit); // comes from assets
imageview_logo.setAdjustViewBounds(true);
imageview_logo.setScaleType(ImageView.ScaleType.FIT_CENTER);
imageview_logo.setBackgroundColor(0x00000000);
imageview_logo.setPadding(0, 0, 0, 0);
imageview_logo.setVisibility(v.VISIBLE);
Run Code Online (Sandbox Code Playgroud)
以这种方式加载图像时,似乎没有进行缩放.但是,如果我通过setImageDrawable()r.res加载图像.里面的图像ImageView调整大小.但是,我需要使用setImageBitmap(),因为我通过assets文件夹加载我的图像.
我在这里错过了一些设置吗?这将使Android调整大小并缩放位图,因此它使用ImageView的全宽度?我想我可以自己在代码中做到这一点,但是我会想通过设置一些属性来支持我想做的事情.
我有一个用Delphi/FireMonkey开发的旧iOS应用程序.现在,客户打电话说他的应用程序不能与屏幕阅读器一起使用 - 如果有解决方案的话.
我想我将不得不升级到lates Delphi版本,但除此之外 - 是否可以使用Delphi/FireMonkey控件?我可以看到他们在OSX和Windows中对屏幕阅读器有FireMonkey JAWS/VoiceOver支持,但看起来不是iOS吗?
我能找到的所有代码都围绕将图像直接加载到可视控件中.
但是,我有自己的缓存系统(从另一种语言转换项目),所以我尽可能高效地想要以下内容:
我是swift和ios平台的新手,但据我所知,cgimage尽可能接近?但是,当使用cgimage时,似乎没有办法从文件系统加载图像...但是我发现人们正在讨论UIImage的方法,所以我现在怀疑我最初的印象ha cgimage是最好的匹配我的需要.
所以在离开我的Android Studio项目一段时间后,我运行了所有更新.
我的构建gradle定义了这个
compileSdkVersion 23
buildToolsVersion '23.0.1'
Run Code Online (Sandbox Code Playgroud)
但是,现在当我重建所有时,我得到错误:
W:\ android-studio-projects\sharedid\app\build\intermediates\res\merged\debug\values-v24\values-v24.xml错误:(3)检索项目的父项时出错:找不到与给定项匹配的资源name'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.错误:(4)检索项目的父项时出错:找不到与给定名称"android:TextAppearance.Material.Widget.Button.Colored"匹配的资源.错误:(3)检索项目的父项时出错:找不到与给定名称"android:TextAppearance.Material.Widget.Button.Borderless.Colored"匹配的资源.错误:(4)检索项目的父项时出错:找不到与给定名称"android:TextAppearance.Material.Widget.Button.Colored"匹配的资源.
这是文件 - 不是我创建的文件:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Borderless.Colored" parent="android:TextAppearance.Material.Widget.Button.Borderless.Colored"/>
<style name="Base.TextAppearance.AppCompat.Widget.Button.Colored" parent="android:TextAppearance.Material.Widget.Button.Colored"/>
<style name="TextAppearance.AppCompat.Notification.Info.Media"/>
<style name="TextAppearance.AppCompat.Notification.Media"/>
<style name="TextAppearance.AppCompat.Notification.Time.Media"/>
<style name="TextAppearance.AppCompat.Notification.Title.Media"/>
</resources>
Run Code Online (Sandbox Code Playgroud)
我在这里不明白的事情 - 这个错误似乎源于Android库本身的一个问题 - 而且与我的代码没有直接关系.
由于我的编译SDK和构建版本没有改变 - 我怎么能突然开始收到这个错误?我该如何解决?
我正在尝试实现 nsurlconnectiondatadelegate,因为我需要支持异步模式 - 在同步模式下,我不想要自动遵循重定向。
作为参考,我有使用 urlRequest 等在同步模式下工作的代码。
问题是我无法让 FPC/Lazarus 编译我的代码。
...
代码片段
{$mode objfpc}
{$modeswitch objectivec1}
{$modeswitch objectivec2}
Run Code Online (Sandbox Code Playgroud)
...
// We need to implement support for NSURLConnectionDelegate and NSURLConnectionDataDelegate
TmsMacRequestDelegate = objcclass(NSObject)
public
// this will set flag when done
procedure connectionDidFinishLoading(ANSUC: NSURLConnection); message onnectionDidFinishLoading:'; override;
// ... implement rest?
end;
Run Code Online (Sandbox Code Playgroud)
...
requestDelegate := TmsMacRequestDelegate.alloc.init;
urlConnection := NSURLConnection.connectionWithRequest_delegate(urlRequest, requestDelegate);
// ... setup flag
urlConnection.start;
// ... wait here in loop checking flag set by "finish loading"
Run Code Online (Sandbox Code Playgroud)
...
有了上述内容,初步测试似乎不太顺利。我们到达 urlConnection.start; 但 …
我正在转换一个Swift 2.3项目o Swift 3并挖掘数千个变化
我目前有这样的代码:
outletCatalog.scrollToRowAtIndexPath(myIndex, atScrollPoisition: .top, animated: false)
Run Code Online (Sandbox Code Playgroud)
但是,它显然被替换为
func scrollToRow(at: IndexPath, at: UITableViewScrollPosition, animated: Bool)
Run Code Online (Sandbox Code Playgroud)
但是 - 我不明白"at"的双参数命名,我的Google搜索没有产生任何结果.代码翻译工具只是表明了它
scrollToRow(at:at:animated)
Run Code Online (Sandbox Code Playgroud) 从转换旧版本的swift时,我收到警告
func imagePickerController(_ picker: UIImagePickerController, didFinishPickingMediaWithInfo info: [String: AnyObject])
Run Code Online (Sandbox Code Playgroud)
警告是
实例方法'imagePickerController(:didFinishPickingMediaWithInfo :)'几乎匹配协议UIImagePickerControllerDelegae的可选要求'imagePickerController(:didFinishPickingMediaWithInfo :)'
这里的问题是,就我的眼睛而言,它所抱怨的内容以及它所说的近乎匹配的内容是100%相同的.我该如何解决此警告?