Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
How to change Selected Cell color in iOS
SUBMITTED BY:
Guest
DATE:
Jan. 8, 2014, 9:25 a.m.
FORMAT:
C#
SIZE:
806 Bytes
Raw
Download
Tweet
HITS:
1250
Go to comments
Report
Hello
friends
,
Here
it
is
a
simple
but
sometimes
useful
for
how
to
change
the
text
color
on
row
selection
in
TableView
for
xcode
:
CODE
:
In
function
:
-
(
UITableViewCell
*
)
tableView
:(
UITableView
*
)
tableView
cellForRowAtIndexPath
:(
NSIndexPath
*
)
indexPath
{
}
Do
this
:
cell
.
textLabel
.
textColor
=
[
UIColor
white
Color
];
cell
.
textLabel
.
highlightedTextColor
=
[
UIColor
blackColor
];
cell
.
detailTextLabel
.
textColor
=
[
UIColor
grayColor
];
cell
.
detailTextLabel
.
highlightedTextColor
=
[
UIColor
redColor
];
here
what
will
happen
,
on
initial
loading
the
color
for
textLabel
and
detail
text
Label
will
be
white
and
gray
respectively
,
on
selecting
the
row
the
color
will
change
to
black
for
textLabel
and
red
for
detailTextLabel
.
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus