Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7440393
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:50:41+00:00 2026-05-29T10:50:41+00:00

I am creating a NC Widget and can’t seem to adjust the height of

  • 0

I am creating a NC Widget and can’t seem to adjust the height of the widget.

Here is my code:

-(UIView *)view {
if (_view == nil)
{
    CGRect frame = CGRectMake(2,0,316,191); // Added
    _view = [[[UIView alloc] initWithFrame:(frame)] autorelease]; //(2., 0., 316., 71.)]; <--ORIGINAL VALUE

    // Setting frame Height dont work... :/

    UIImage *bg = [[UIImage imageWithContentsOfFile:@"/System/Library/WeeAppPlugins/SMSWidget.bundle/Background.png"] stretchableImageWithLeftCapWidth:5 topCapHeight:71];
    UIImageView *bgView = [[UIImageView alloc] initWithImage:bg];
    bgView.frame = CGRectMake(0, 0, 316, 191);
    [_view addSubview:bgView];
    [bgView release];

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:50:42+00:00Added an answer on May 29, 2026 at 10:50 am

    This is an example of how you can do that :

    float myWidgetHeigth = 500 ; // The desired height
    _view = [[UIView alloc] initWithFrame:CGRectMake(2, 0, 316, myWidgetHeigth)];
    
    UIImage *bg = [[UIImage imageWithContentsOfFile:@"/System/Library/WeeAppPlugins/WorldClockNC.bundle/WeeAppBackground.png"] resizableImageWithCapInsets:UIEdgeInsetsMake(5, 5, 5, 5)];
    UIImageView bgview = [[UIImageView alloc] initWithImage:bg];
    bgview.frame = CGRectMake(0, 0, 316, myWidgetHeigth);
    [_view addSubview:bgview];
    

    If you are developing a plugin for the notification Center, refer to the BBWeeAppController-Protocol.h you will need also to implement this method : “- (float)viewHeight”.

    Also, I have seen from your code you are using theses methods “stretchableImageWithLeftCapWidth:5 topCapHeight:71”, that are deprecated in IOS 5.0 –> https://developer.apple.com/library/ios/#documentation/uikit/reference/UIImage_Class/DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/instm/UIImage/stretchableImageWithLeftCapWidth:topCapHeight: So, use the method “resizableImageWithCapInsets” ;-).

    I’m not a pro on it, I’m learning ObjC, so if you have somes questions, let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is my situation: Im creating a widget that site admins can embed in
I am creating a widget that you can assign a contact to onClick. I
I am creating a new ExtJS widget using Ext.view.View. The template for this view
Cocoa newbie here. I am working on an iPhone UITableViewController-based widget that can be
I'm creating a widget where the user in the configuration activity can select from
I'm creating a javascript widget so third partys (web designers) can post a link
how can I capture focus event in some widget (for example QLineEdit) without creating
For a widget I am creating for the Android OS, I want the user
I am creating a small silverlight widget which pronounces a word and highlights each
I am creating a simple Android widget with a typical usecase of having many

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.