亲宝软件园·资讯

展开

Xcode9 AppIcon 图标在iOS11上不显示 iOS11上Xcode9 AppIcon 图标不显示

allentsing 人气:0
想了解iOS11上Xcode9 AppIcon 图标不显示的相关内容吗,allentsing在本文为您仔细讲解Xcode9 AppIcon 图标在iOS11上不显示的相关知识和一些Code实例,欢迎阅读和指正,我们先划重点:Xcode9,AppIcon,不显示,Xcode9,IOS11图标不显示,ios11,APPicon不显示,下面大家一起来学习吧。

实例一:

打开工程目录下:[工程名]/Pods/Target Support Files/Pods-[工程名]/Pods-[工程名]-resources.sh这个文件,替换最后一段代码:

修改前:

printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text 
--notices 
--warnings --platform "${PLATFORM_NAME}" 
--minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} 
--compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
fi

修改后:

printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"
fi

然后重新运行工程即可

实例二:

在Xcode9下新建一个工程看一下, 设置图标是显示的, 但是假如CocoaPod就不显示了. 多方查询发现
图标不显示主要是cocoaPod出现了问题, 需要在podfile文件加入以下脚本 [标红的地方]

1.加入脚本

platform :ios, '8.0'

target ‘lqz' do
  pod 'MJRefresh'
  pod 'AFNetworking'
  
post_install do |installer|
  copy_pods_resources_path = "Pods/Target Support Files/Pods-[工程名]/Pods-[工程名]-resources.sh"
  string_to_replace = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"'
  assets_compile_with_app_icon_arguments = '--compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${BUILD_DIR}/assetcatalog_generated_info.plist"'
  text = File.read(copy_pods_resources_path)
  new_contents = text.gsub(string_to_replace, assets_compile_with_app_icon_arguments)
  File.open(copy_pods_resources_path, "w") {|file| file.puts new_contents }
  
end

加载全部内容

相关教程
猜你喜欢
用户评论