前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         CSDN:
http://www.csdn.net
         雨季o莫忧离:http://blog.csdn.net/luckkof

正文

需要在设置-->关于手机 界面定制一个界面类似下图。即需要在preference_srceen中添加图片。
 
 
 
[SOLUTION]

1:在Setting的source code的
src\com\android\settings
文件中添加一个类LogoPreference.java
文件内容如下:
package com.android.settings;
import android.content.Context;

import android.preference.Preference;

import android.util.AttributeSet;

import android.view.View;

import android.view.ViewGroup;

import android.widget.RadioButton;

import android.widget.RelativeLayout;
public class LogoPreference extends Preference {
    /**

     * @param context

     * @param attrs

     * @param defStyle

     */

    public LogoPreference(Context context, AttributeSet attrs, int defStyle) {

        super(context, attrs, defStyle);

        init();

    }
    /**

     * @param context

     * @param attrs

     */

    public LogoPreference(Context context, AttributeSet attrs) {

        super(context, attrs);

        init();

    }
    /**

     * @param context

     */

    public LogoPreference(Context context) {

        super(context);

        init();

    }
    private void init() {

        setLayoutResource(R.layout.logo_preference_layout);

    }

    

    @Override

    public View getView(View convertView, ViewGroup parent) {

        View view = super.getView(convertView, parent);

        return view;

    }
}

2,在Setting的res\layout目录下添加一个对应的
logo_preference_layout.xml文件。
文件内容如下:
<?xml version="1.0" encoding="utf-8" ?>
- 
<
LinearLayout
 xmlns:android
="
http://schemas.android.com/apk/res/android
"
 android:layout_width
="
match_parent
"
 android:layout_height
="
200dip
"
 android:minHeight
="
?android:attr/listPreferredItemHeight
"
 android:orientation
="
vertical
"
 android:gravity
="
center_vertical
">
  
<
ImageView 
android:id
="
@+android:id/icon
"
 android:layout_width
="
300dip
"
 android:layout_height
="
200dip
"
 android:paddingStart
="
0dip
"
 android:paddingEnd
="
0dip
"
 android:layout_gravity
="
center_vertical
"/>

- 
<
RelativeLayout android:id
="
@+android:id/text_layout
"
 android:layout_width
="
0dip
"
 android:layout_height
="
0dip
"
 android:paddingStart
="
0dip
"
 android:paddingEnd
="
0dip
"
 android:gravity
="
center_vertical
"
android:layout_weight
="
1
"
 android:focusable
="
true
"
 android:background
="
@drawable/list_selector_holo_dark
">
  
<
TextView 
android:id
="
@+android:id/title
"
 android:layout_width
="
0dip
"
 android:layout_height
="
wrap_content
"
 android:focusable
="
true
"
 android:singleLine
="
true
"
 android:textAppearance
="
?android:attr/textAppearanceMedium
" />

  
<
TextView 
android:id
="
@+android:id/summary
"
 android:layout_width
="
0dip
"
 android:layout_height
="
wrap_content
"
 android:layout_below
="
@android:id/title
"
 android:layout_alignStart
="
@android:id/title
"
 android:textAppearance
="
?android:attr/textAppearanceSmall
"
 android:maxLines
="
2
" />

  
</
RelativeLayout
>

  
</
LinearLayout
>
 
3:在Setting的device_info_settings.xml中添加一个LogoPreference
<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android" android:title="@string/about_settings">

  
<
com.android.settings.LogoPreference android:key="jasonAAA
"
 android:icon
="
@drawable/pic_indicator
" />

 
重新编译Setting并push到手机中可以看到上图的效果,如果贵司要更改为自己公司的Logo图片,
只需修改
android:icon
="
@drawable/
pic_indicator为贵司自己
公司的Logo图片即可。

Android 如何在关于手机界面添加个图片的更多相关文章

  1. [Android] 通过GridView仿微信动态添加本地图片

    原文:http://blog.csdn.net/eastmount/article/details/41808179 前面文章讲述的都是"随手拍"中图像处理的操作,此篇文章主要讲述 ...

  2. Android Fragment学习笔记(二)----Fragment界面添加和管理

    Fragment界面添加 了解过fragment的生命周期等简单知识,于是去看官方文档来了解更多相关内容,要添加fragment到我们的UI界面中,给出了两种常用的方法,第一个是在activity的布 ...

  3. 精美的 ( Android, iPhone, iPad ) 手机界面设计素材和线框图设计工具

    在制作界面原型的时候,如果有现成的界面基础元素可以使用的话,设计师就可以非常快速的完成原型的制作,能够节省大量的时间和精力.在这篇文章, 我向大家分享45套非常有用的 UI 和 Wireframe 套 ...

  4. Android项目实战_手机安全卫士home界面

    # 安全卫士主页面# ###1.GridView控件 1.与ListView的使用方式差不多,也要使用数据适配器,通过设置android:numColumns控制显示几列 2.通过指定android: ...

  5. 【转】android 安卓APP获取手机设备信息和手机号码的代码示例

    http://blog.csdn.net/changemyself/article/details/7421476 下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓 ...

  6. 实现了在android实现左右滑动切换界面的效果

    这是实现了在android实现左右滑动切换界面的效果,该效果的源码下载,请到源码天堂下载吧,喜欢的朋友可以研究一下. 布局文件 <?xml version="1.0" enc ...

  7. Android基础之——startActivityForResult启动界面并返回数据,上传头像

    在android应用的开发过程中,常常会出现启动一个界面后填写部分内容后带着数据返回启动前的界面,最典型的应用就是登录过程.在非常多应用程序的模块中,都有"我的"这个模块,在未登录 ...

  8. 使用Android studio作按键切换界面

    一.新建工程 二.新建一个按键             android:layout_width="wrap_content"         android:layout_hei ...

  9. android 安卓APP获取手机设备信息和手机号码的代码示例

    下面我从安卓开发的角度,简单写一下如何获取手机设备信息和手机号码 准备条件:一部安卓手机.手机SIM卡确保插入手机里.eclipse ADT和android-sdk开发环境 第一步:新建一个andro ...

随机推荐

  1. Python BeautifulSoup 简单笔记

    Beautiful Soup 是用 Python 写的一个 HTML/XML 的解析器,它可以很好的处理不规范标记并生成剖析树.通常用来分析爬虫抓取的web文档.对于 不规则的 Html文档,也有很多 ...

  2. Flask实战第41天:发送短信验证码

    本项目使用的短信运营商是阿里云.使用淘宝账号登录阿里云控制台.在“产品与服务”中搜索“短信”进入短信服务 获取AccessKey 输入子账户用户名 权限选择管理短信服务 签名管理:申请签名 模板管理: ...

  3. 50 years, 50 colors HDU - 1498(最小点覆盖或者说最小顶点匹配)

    On Octorber 21st, HDU 50-year-celebration, 50-color balloons floating around the campus, it's so nic ...

  4. [NOIP2017]时间复杂度(模拟)

    sscanf读入数字,getline(cin,string)读一整行,其余暴力模拟即可. #include<cstdio> #include<string> #include& ...

  5. 【计算几何】CDOJ1720 几何几何

    #include<cstdio> #include<algorithm> #include<cmath> using namespace std; #define ...

  6. [HDU1756]Cupid's Arrow

    题目大意: 给你一个简单多边形和若干个点,问每个点在多边形内还是外. 思路: 一开始没看清楚题,写了一个叉积法,事实上叉积法只能用来处理凸多边形与点的关系. 考虑一个射线法. 从这个点水平往左作一条射 ...

  7. ArrayList之扩容与迭代器

    1. 扩容 ArrayList扩容包括ensureCapacity(对外开放)和ensureCapacityInternal(内部隐式调用)两个接口: 1' 两者都调用ensureExplicitCa ...

  8. Codeforces Gym 100269A Arrangement of Contest 水题

    Problem A. Arrangement of Contest 题目连接: http://codeforces.com/gym/100269/attachments Description Lit ...

  9. centos6.5编译安装nginx

    系统64位 centos6.5 nginx官网:http://nginx.org/ 下载nginx源码包: wget  http://nginx.org/download/nginx-1.6.2.ta ...

  10. 通过现有数据导出新表SQL

    Date: 20140217 Auth: JIN 需求: 导出一个表的两个列的表的SQL语句(包含数据) 方法:创立一个临时表 mysql> desc kw_keywords;+-------- ...