tabbaritem的png無法顯示、是gray

  • warning: Declaration of views_handler_argument::init(&$view, &$options) should be compatible with views_handler::init(&$view, $options) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_argument.inc on line 745.
  • warning: Declaration of views_handler_filter::options_validate(&$form, &$form_state) should be compatible with views_handler::options_validate($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • warning: Declaration of views_handler_filter::options_submit(&$form, &$form_state) should be compatible with views_handler::options_submit($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter.inc on line 585.
  • warning: Declaration of views_handler_filter_boolean_operator::value_validate(&$form, &$form_state) should be compatible with views_handler_filter::value_validate($form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/handlers/views_handler_filter_boolean_operator.inc on line 149.
  • warning: Declaration of views_plugin_style_default::options(&$options) should be compatible with views_object::options() in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_style_default.inc on line 25.
  • warning: Declaration of views_plugin_row::options_validate($form, &$form_state) should be compatible with views_plugin::options_validate(&$form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.
  • warning: Declaration of views_plugin_row::options_submit($form, &$form_state) should be compatible with views_plugin::options_submit(&$form, &$form_state) in /home/xnvgu7/public_html/sites/all/modules/views/plugins/views_plugin_row.inc on line 135.

tabbaritem的png無法顯示、是gray:2011年04月04日星期一

使用tabbarcontroller,需要更改tabbaritem上的image,一般都用.png檔,實作發現,許多.png檔無法顯示,呈現出來的是一片灰白-gray。

原因:.png檔的background必需為透明(transparent)。

解法:

找免費軟體GIMP2。

打開GIMP2,檔案/新增,寬度、高度各鍵入32,點進階選項左的+號,填上右的背景顏色改為透明,點確定。點工具箱的A,點剛新增的圖層,鍵入B,將B調整覆蓋前一圖層,點圖層/向下合併,現在有了一個32x32英文字B的透明icon.

點檔案/另存新檔,選folder,鍵入檔名(例如B1.),點選擇檔案格式左之+號,選png檔,點儲存。再將B1.png存入Xcode project內。

這時回tabbarcontroller的.nib、例如MainWindow.nib,點MainWindow.nib,再點Tab Bar Controller icon,再雙點苿tabbaritem後,點Tools/Attribute inspector, 點Image右,選B1.png。tabbaritem的png正常顯示了。

問題:如何將原本background不透明的.png改為background透明?