This tutorial will be about adding a header image to your Preference Bundle or Patcher using PFHeaderCell by PixelFire. It was requested by @@dzcracker here. Before we begin, the tutorial will be newbie friendly but you can also follow the simple instructions on the Developers GitHub page: https://github.com/PixelFireDev/PFHeaderCell @@castix also made a Template with the Header Cell ready to be used which can be downloaded from here: https://www.dropbox.com/s/odkqwl2ljbqfj9g/iosgods_pfheader.nic.tar (extract it to /theos/templates/iphone/) Requirements: - Jailbreak - Theos installed (Tutorial here) - iFile/Filza/iFunBox/iTools etc. for editing the files. Instructions: We will be using the Patcher Temaplate from here for ease instead of the default theos templates. Step 1: Start a new project and select the iosgods/patcher option if you're using the template above.
Step 2: Download the PFHeaderCell.mm and PFHeaderCell.h from here https://github.com/PixelFireDev/PFHeaderCell Step 3: Send the PFHeaderCell.mm and PFHeaderCell.h to your /ProjectFolder/ProjectFolderPreferences/ (in my case it's /var/root/testheader/TestHeader/) Step 4: Now we need to include the 2 files inside Makefile so edit your Makefile with any text editor and PFHeaderCell like this:
ProjectName_FILES = ProjectName.mm PFHeaderCell.mm
Step 5: Save the Makefile and enter the "Resources" folder so we can edit the ProjectName.plist. Step 6: Edit the ProjectName.plist inside /ProjectFolder/ProjectPreferences/Resources/ and add this XML code at the top right under the <array> tag opens.
<dict>
<key>cell</key>
<string>PSStaticTextCell</string>
<key>cellClass</key>
<string>PFHeaderCell</string>
<key>background</key>
<string>#EFEFF4</string>
<key>image</key>
<string>/Library/PreferenceBundles/ProjectNamePreferences.bundle/header.png</string>
<key>height</key>
<integer>100</integer>
</dict>
Example:
Step 7: Save the plist you just modified and now we will need the Header Images. Headers have to be scaled in 320x100 pixels and 640x200 (or 750x250 - mess around with the resolutions) for @2x resolution. For best results, make the header image with a transparent background so open up Photoshop and get to work. Once you have your images, place them in the /Resources/ folder and make sure their names are header.png &
[email protected] otherwise the header image won't appear. Step 8: Now compile and install your package then check your iDevice settings.
iOSGods-iPad:~ root# cd /var/root/testheader
iOSGods-iPad:~/testheader root# make package install
Finished result: The head quality of the picture if because I resized the image with Photoshop instead of making it from scratch. Credits: PixelFireDev @castix @DiDA