How to Hide Android WebView Highlight Border (or change it’s color)

Here's one that had me at a loss for a long time that I just figured out. You can easily remove the highlight border (the border that comes up when an element is focused) or change it's color in a WebView with CSS! The WebKit-specific property "-webkit-tap-highlight-color" is what you're looking for.

The following line will disable it on a page completely:

1
2
3
* {
	-webkit-tap-highlight-color: rgba(0, 0, 0, 0);	
}

rgba() is just like rgb(), but it takes a 4th parameter for opacity. It's my belief that this would probably work for iPhone WebView's as well, since both Chrome and Safari are based off of WebKit.

Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
 
 

Windows 7 Icons Download

Looking to use Windows 7 icons in your applications or extensions? Download the following file to conveniently access them.

Download Windows 7 Icons Zip File (8.91 MB)

Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
 
 

PHP RSS Parser – RSS Reader Class for PHP

Just had to create a quick RSS parser for PHP and thought I'd post my solution. The implementation and class follows.

<?php
$rss = new RSSReader('http://news.google.com/?output=rss');
while ($rss -> hasNext())
	print_r($rss -> next());
?>
<?php
class RSSReader {
	var $xml = null;
	var $pos = 0;
	var $count = 0;

	function __construct($feed_url) {
		$this -> load_url($feed_url);
	}

	function load_url($feed_url) {
		$this -> load_string(file_get_contents($feed_url));
	}

	function load_string($feed_string) {
		$this -> xml = simplexml_load_string(str_replace('content:encoded', 'content_encoded', $feed_string));
		$this -> pos = 0;
		$this -> count = count($this -> xml -> channel -> item);
	}

	function get_title() {
		return $this -> xml -> channel -> title;
	}

	function get_link() {
		return $this -> xml -> channel -> link;
	}

	function get_pubdate() {
		return $this -> xml -> channel -> pubdate;
	}

	function hasNext() {
		return $this -> count > $this -> pos;
	}

	function next() {
		$obj = $this -> xml -> channel -> item[$this -> pos++];
		return array(
			'title' => (string) $obj -> title,
			'link' => (string) $obj -> link,
			'description' => (string) $obj -> description,
			'content' => (string) $obj -> content_encoded,
			'pubDate' => strtotime($obj -> pubDate),
		);
	}
}
?>
Bookmark this page
[del.icio.us] [Digg] [Facebook] [Google] [Reddit] [Slashdot] [StumbleUpon]
 
 
 
 

» Recent Comments

  • Dan: It's CSS, so you can put...
  • Andy: Hi, Where do i actually ...
  • Mian Waqas: Thanks for such a nice c...

» Meta