Default UITableViewCell text label background color

I need a table view cell that just has simple text but with custom backgroundView images when not selected vs. selected. I'm too lazy to implement a custom cell, so I was using the regulation UITableViewCell, setting the backgroundView and backgroundSelectedView. The problem is for non-white backgroundView, when the cell is not selected, the text has a white box around it (the background color of the label containing the text, I assume), which looks horrible. When the cell is selected, the default UITableViewCell implementation takes care of changing the text color to white and text label background to clearColor and the custom backgroundSelectedView shows through beautifully. Is there a reason why the text label shouldn't just have a clear background color ALL THE TIME?? If the UITableViewCell is not customized for backgroundView, i.e., the cell background is white, the clear colored text label is no different from a white colored text label. If the backgroundViews are customized to non-white, a clear text label won't be in the way of the backgroundView showing through.
Does this sound like a good feature request?
How does one submit requests or bug reports for iPhone SDK anyways??
Thanks.

fitzyjoe wrote:
I am having this exact same problem right now. Did you have to subclass UITableViewCell to fix it?
I had the same problem and subclassed UITableViewCell to solve it. I set the backgroundView and selectedBackgroundView to UIView instances I wanted to use and then implemented setSelected:animated: in my subclass.
{code:}
-(void)setSelected:(BOOL)selected animated: (BOOL)animated {
[super setSelected: selected animated: animated];
for (UIView *view in self.contentView.subviews) {
view.backgroundColor = [UIColor clearColor];
{code}
Bit bruteforce and as Apple suggests this will impact table performance, but the tables I work with aren't that big and it works well so far.
It'd be nice if UITableViewCell honored backgroundView like it does selectedBackgroundView, i.e. when the backgroundView property is set keep the cell contents transparent.

Similar Messages

  • Numeric Control - Text and Background Color changes when operating inc/dec arrows

    Hi,
    I'm developing an application that has a panel with black background and green or red numbers. I've added numeric controls and configured the text color and text background color attributes accordinglingy. I set the numeric control to hot or validate  control mode and show the inc/dec arrows, since I want to be able to incr/decr the numbers.
    The problem is that when I run the application and I hit the inc/dec arrows, then the colors inside the numeric control frame become inverted: the black background becomes white and the green number becomes cyan. I've created a callback function assosicated with the numeric control and tried forcing the text and background color, in the EVENT_VAL_CHANGED section, using the SetCtrlAttrribute() function, but to no avail. Also added ProcessDrawEvents didn't help.
    When I mouse click again outside the numeric control, then it reverts back to its original colors (green text, black background).
    Any suggestions as to how I can fix this ?
    I want it to keep its original colors at all times, even when I'm clicking the incr/decr arrows...
    Kind regards,
    pgriep
    Solved!
    Go to Solution.

    Ok, now I see what's happening.
    The effect you are seeing is a resul of standard numeric control behaviour combined with the black bcakground: when you use arrows to increment/decrement a numeric control its value will be automatically highlighted; on the default background you'll see the white area and figures highlighted in black (white numbers on balck background). If you set the background to black the system will automatically change the colors used to highlight the text, and that's what you're seeing.
    By the way, this does not happens if you use up and down keys on the keyboard: text is not highlighted so colors are not changing.
    Additionally, this is not only valid for numerics: see the behaviour of the string controls on the bottom of your panel when you tab up to them. This effect does not happen on controls set as indicator like the big clock in the upper part of the panel.
    The only way I can see to overcome this behaviour is to hide control built-in arrows and create your own up and down buttons with which you can manipulate the numeric control. I am attaching a modified version of your project with buttons on the left numeric; sorry for the poor aesthetic:  I have used some arrow icons I had on my disk, you may want to create your own arrows with the colors and shape you prefer.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?
    Attachments:
    ModifiedApplication.zip ‏9 KB

  • Selectable mx:Label background color property

    How can I change background color of selected text in my mx:Label when selectable=true.  Default color is blue.
    thanks in advance

    Hi,
    I think you should use something else for this use instead of Label.That will be better.
    But if you want to do this with Label only then the solution is as below.
    Create you own Label class which extends Label class of flex.And then use as I hv used it in my application.Below is the source
    code for both.
    CustomLabel.as
    package
        import mx.controls.Label;
        public class CustomLabel extends Label
            public function CustomLabel()
                super();
            public function getTxt() : *
                return textField;
    MainApplication
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
            layout="vertical"
            xmlns:local="*">
        <mx:Script>
            <![CDATA[
                private function onCreationComplete():void
                    customLabel.getTxt().background = true;
                    customLabel.getTxt().backgroundColor = '0xFFFF00';
            ]]>
        </mx:Script>
        <local:CustomLabel id="customLabel" text="Hello world" selectable="true" creationComplete="onCreationComplete()"/>
    </mx:Application>
    Let me know if u hv any issue.
    with Regards,
    Shardul Singh Bartwal

  • How to change linux text area background color?

    Hi,
    I like to know the method. just like in windows platform.

    Just like change the text area color in notepad.exe
    so i mean X11 and gnome.
    do you mean inside a terminal when you're running X
    No, i can change the color in gnome terminal.
    But i can not change the color in openldev(or any other gtk apps)
    I hate the default color(white),
    want text background color as grey, without configure each apps color.

  • Item: Display as Text - change background-color - problem in IE

    Hi,
    I have six display items, where I want to change the background-color, when moving the mouse over it.
    I'm using javascript to do this, it's looking like this:
    Call in Label: HTML Table CellAttributes: onmouseover="tab_mouseover('TAB1')" onmouseout = "tab_mouseout('TAB1')"
    Javasacript:
    function tab_mouseover(pThis)
    var el = html_GetElement('P229_' + pThis +'_label').parentNode.parentNode;     
    el.setAttribute('style', 'background-color: rgb(160,200,240)');     
    function tab_mouseout(pThis)
    var el = html_GetElement('P229_' + pThis +'_label').parentNode.parentNode;     
    el.removeAttribute('style');     
    It works properly fine in Firefox 2.0, but in IE 6 and 7 nothing happens, no error no background change.As far I could find, this functions should work in both browsers.
    Has anybody any idea what's the problem with this in IE?
    Thanks for help
    chrissy

    Hi,
    I think that the problem could have been because getAttribute and setAttribute use case-sensitive attribute names by default. You could also have tried doing:
    el.setAttribute('style', 'background-color: rgb(160,200,240)', 0);
    - the extra parameter of 0 tells the browser to ignore the case of the attribute name.
    The method could have been failing because there was a STYLE attribute as well and this was taking precendence.
    But, on the whole, I prefer to use Andy's method unless I'm creating a complete object from scratch in javascript.
    Andy

  • Logon Page - Trademark text and background color

    Hi Guys,
    I just customized the Logon Page of the Portal successfully. The only two things which are missing are the trademark as well as a new background color. So ... can anybody tell how to:
    1. Change the SAP Trademark text in the Logon Page?
    2. Change the background color of the background page?
    Hopefully I can do it in the portal. Thanks for your answers and your help.
    Best regards
    Alexander

    Alexander,
    In addition to the tips you already got from the other members...
    1. The Background colour is the background colour that is defined in the theme assigned in the Default Portal Desktop (defaultDesktop) that is located in the folder: pcd:portal_content/every_user/general/. By default the Tradeshow theme is selected in this desktop if you create your own theme and assign it to this desktop and set it as default then the background colour of your theme will be the background colour visible in the login page....
    2. The Trademark text is a "Locale text" this means that the strin is not visible in the code but referenced by a variable based on the language of the browser. You can find this copywrite text in the following location:
    a. Download the com.sap.portal.runtime.logon.par file from your Portal
    b. Import it in NWDS or unzip it.
    c. inside the structure look for the folder PORTAL-INF\lib
    d. there is a .jar file called umelogonbase.jar. extract this file with winzip
    e. inside the structure you now see allot of .properties files.. look for the loginLabels_<yourcountrycode>.properties and inside this file look for the variable called "COPY_RIGHT" there you can edit it.
    f. do this for all the languages you need and create a new par file again in your customer namespace so that you don't overwrite the one from SAP.
    Good Luck,
    Benjamin Houttuin

  • UITableViewCell.textLabel change background color to clear color OS 3.0

    i have a table view and ffor the cells i set the background color alternatively to [UIColor darkGrayColor] and whitecolor. The problem that i have is that the textLabel from the cell has the background white. i tried to set the background color to the label to clear color with [[cell textLabel] setBackgroundColor:[UIColor clearColor]]; but it is still white... if i add a label as a subview to the cell and i set the background color to clear it works...any idea why this doesn't work for that textLabel?
    the problem is like in the photo at the link i provided...
    http://img269.imageshack.us/img269/9001/picture1wim.png

    Hello, i tried that also but the result is the same as in the picture... here are my current settings for the textLabel of the cell:
    [[cell textLabel] setOpaque:NO];
    [[cell textLabel] setBackgroundColor:[UIColor clearColor]];
    [[cell textLabel] setText:[dict objectForKey:@"title"]];
    [[cell textLabel] setTextColor:[UIColor blackColor]];
    [[cell textLabel] setNumberOfLines:3];
    [[cell textLabel] setFont:[UIFont boldSystemFontOfSize:12]];
    Message was edited by: ISorinu'

  • How to set text and background color of current row in a adf table?

    Hi,
    In jdev 11.1.2.3,
    How to set text fond and background color of current row in a adf table?
    I tried to set Background color in table property, but that is not what i want.
    Thanks.

    Hi,
    We almost had the same requirement, but we just needed to color a specific column.
    Here goes the solution to that, you might do the same for your row highlighting
    Changes are required in jsff and one method to be added in backing bean
    1. JSFF :
    <af:column headerText="Amount"
                     id="c4" width="100"
                     inlineStyle="#{backingBeanScope.BackingBean.cellColor}">2. Backing Bean
    //searchResultTableVO is Table's VO
    public String getCellColor() {
          FacesContext ctx = FacesContext.getCurrentInstance();
          ExpressionFactory ef = ctx.getApplication().getExpressionFactory();
          ValueExpression ve = ef.createValueExpression(ctx.getELContext(), "#{row}", FacesCtrlHierNodeBinding.class);
          FacesCtrlHierNodeBinding node = (FacesCtrlHierNodeBinding)ve.getValue(ctx.getELContext());
          Row row = node.getRow();
        if(row.equals(searchResultTableVO.getCurrentRow())){
    //You can add your inline style for font-style too
          return "background-color:Red;";
             return null;
      }Hope this is helpful :)
    Regards,
    Neha..

  • Menu text and background colors

    The menus in Acrobat Reader on Windows 7 seem to use:
    - System colors for text,
    - Forced grey for background color.
    My Windows 7 is setup to have light grey text on dark background. All other programs honor this. The result in Reader is that I have light grey text on grey background, which is not readable:
    The same is valid for the bookmarks field, as shown above.
    It's either:
    - take system colors for both background and foreground (preferred)
    - force colors for both background and foreground.
    You'd think that Adobe would know about that kind of problems...
    Is there a work-around?

    You have to clear your browser history/cache or all of the links you have visited in the past (while previewing) will show as the visited style which is a white background and black text.

  • How can I make FF use custom visited/unvisited link colors but allow the website to choose the other text and background colors?

    websites often choose colors that I have trouble distinguishing between but overriding the other colors can cause color defects on certain websites.

    Add code like this to userContent.css in the chrome folder.<br />
    There can however still be problems with clickable elements that use background images.
    Remove that link from the history to restore that background image.
    *http://kb.mozillazine.org/userContent.css
    *http://kb.mozillazine.org/Editing_configuration
    You can use the ChromEdit Plus or Stylish extension to have easier access to the customization files.
    *ChromEdit Plus: http://webdesigns.ms11.net/chromeditp.html
    <pre><nowiki>a:visited, a:visited * {
    color:#CC33CC!important;
    background-color:#F8F8F8;
    </nowiki></pre>

  • Change text and background color when multiple tracks of text

    I am finishing up a project and the client wants the final title card to be white background with colored text. I have read a bit about how to do this but I can't fit it into my situation. My text is on four different tracks, each piece of text "For more information," "email address", "contact", "phone number" So I need to change each one. But the way that I have read about it, it seems those answers are only for one level of text.
    Help?

    You should probably be using boris title 3D rather than the default text generator.  title 3D is part of the fcp default install and is available in the same generator options where the text generator is found under Boris.
    It will allow you to conbine fonts, font sizes, etc in the same clip.
    And then you'll just have to put a color matte on a video track under the clip.
    You can of course just put all your text clips on a track above the color matte and manually change the color of all the text.

  • Images are ghosted, text and background colors are reverted

    My 12 in Powerbook fell from its stand on the wireless keyboard. Now all images are ghosted and the text has gone from black to white and the background has gone from white to black. On startup everything is fine until everything is loaded, then the changes kick in, colors reverse, and the images become ghosted. What do I do?

    Joseph
    It might be possible that the "Switch to white on black" setting in Universal Access has been activated.
    Try pressing the following key combination: apple-alt-control-8
    EDIT: It may be worth checking out the PowerBook with the Apple Hardware Test.
    2.0GHz MacBook, 15" 1.25GHz/12" 1GHz PBs, 2xPPC Mac minis, 12" iBook G4,   Mac OS X (10.4.8)   Cube, 2xTAMs, iPod 4G & nano 2G, 1G & 2G iPs, AEBS, AX

  • Set background color for conditional text fields by click of button.

    Hi,
    I am new to apex, the scenario is when i click on a button i.e. Save, it shoulld compare 2 fields P1 and P2 which are text fields.
    If the value of P1 is greaterthan P2 then the whole P1 text field background color should change to "Red" otherwise in any other condition the P1 field should be "Green" color.
    In which section the color function should be called on the Save button?
    On the page in the HTML Header section i have added the below code but the background color is not getting set.
    <script type="text/javascript">
    function fncChangeColor()
    var num1 = $v('P1');
    var num2 = $v('P2');
    if ( num1 > num2 ) {
    document.getElementById("P1").style.background = "RED";
    else {
    document.getElementById("P1").style.background = "GREEN";
    </script>
    Can any one help me in moving ahead with this scenario with a detailed information.
    Thanks,
    Priyanka.

    Hi,
    Call function on button URL target
    javascript:fncChangeColor()If button should submit page, then I think you do not need color field to green.
    Just change to run submit function.
    <script type="text/javascript">
    function fncChangeColor(){
    var num1 = $v('P1');
    var num2 = $v('P2');
    if ( num1 > num2 ) {
      $x("P1").style.background = "RED";
      return false;
    apex.submit({request:"YOUR_REQUEST"});
    </script>Regards,
    Jari

  • Change background color in rollover?

    Is it possible to have a text box background color change in a rollover? That is, the text color changes AND the background changes.

    I've not seen anything posted by him
    rule of thumb: this is apple forum/discussion board, what post here belong to apple.
    I no longer post code here... the lurkers are around.
    I don't know of any snippet code for that ... can be manipulated by java script.
    yes, http://www.cyclosaurus.com/Home/CyclosaurusBlog/Entries/2009/8/11Pieces_of3.html
    it's on my site.

  • Composing mail with background color?

    Does anyone know of a way to compose a message in Mail with a background color (say, light blue) behind the text? I know Mail lets you choose type colors, and also lets you set text and background colors for the message header as it appears in the directory, but I've not found a way to set a background color for the message window itself. Anybody know how?
    I'm running OS 10.3.9 with Mail 1.3.11.
    Thanks!

    Well, judging by the complete lack of answers from Apple, I think it's safe to say adding background color to a message is not supported in OS X Mail (At least, not 2.1.1).
    The likeliest place to specify a document or background color would have to be the Fonts dialog, since it contains a specific selector for "Document Color". Of course, this is the same Fonts dialog that is integrated throughout the whole OS, and this particular control has no effect on a Mac Mail message. I've tried selecting system colors, web colors, even picked a color using the eyedropper with no success.
    I'm going to speculate that this is because document color is a feature of HTML formatting -not Rich Text formatting- and Mac Mail (up to version 2.1.1) doesn't even offer HTML formatting as an option. Pretty lame, if you ask me.
    That said, I see the version of mail shipping with Leopard is promising custom "stationary", and that usually means HTML format. I guess we'll have to go upgrade the whole OS just to get this rudimentary capability.

Maybe you are looking for

  • How to Debug multiple Applets in a IDE

    Hi, I am relatively new to Java. At work, I have a client-server style application where applets are deployed to the clients in an html page. Background:* The sequence is something like this: - Client goes to the relevant url - The returned html page

  • Using HTML component Images within a tilelist

    I have a very complicated problem and I'm not sure it's even within my ability to achieve if at all but basically in my AIR application I currently have a tilelist populated by a data provider of images which are essentially thumbnail snapshots I've

  • How to place a pdf form online?

    I created a new pdf form with all the necessary field but when i uploaded it online, I could not write anything in the form fiels or tick a box

  • HT5534 When creating a Numbers document (Iworks), the data is does not input in black

    When creating a Numbers document (Iworks), the data is does not show in black.  Cannot read the data entered.  Please help.

  • Ipod Hifi or Soundsticks II (+isub) -  any experiences?

    hi i am using soundsticks II + isub since 2 years for garageband and itunes. they sound pretty well for my taste. it could be a bit wider, sounding into the room, and less directional. so, in the moment i am thinking of an ipod hifi, would it sound b