前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         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. Luogu P2146 软件包管理器(树链剖分+线段树)

    题意 给定\(n\)个软件包,每个软件包都有一个依赖软件包,安装一个软件包必须安装他的依赖软件包,卸载一个软件包必须先卸载所有依赖于它的软件包.给定\(m\)此操作,每次一个操作\(install/u ...

  2. If you want to allow applications containing errors to be published on the server

    If you want to allow applications containing errors to be published on the server, enable the Allow ...

  3. Python开发基础-Day16import模块导入和包的调用

    模块概念 在Python中,一个.py文件就称之为一个模块(Module).使用模块组织代码,最大的好处是大大提高了代码的可维护性 模块一共三种:python标准库.第三方模块.应用程序自定义模块. ...

  4. 【DFS】算24点

    [tyvj2802/RQNOJ74]算24点 描述 几十年前全世界就流行一种数字游戏,至今仍有人乐此不疲.在中国我们把这种游戏称为“算24点”.您作为游戏者将得到4个1~9之间的自然数作为操作数,而您 ...

  5. 【计算几何】【二分】【随机增量法】hdu6167 Missile Interception

    n个半径为R的圆是否有公共部分,等价于询问是否存在一个半径小于R的圆,能覆盖所有n个圆的圆心. 对这n个点求最小圆覆盖即可.从网上扒了个随机增量法的代码. 这样算上二分,复杂度就是nlogn了. #i ...

  6. 操作系统介绍、python基础

    操作系统 什么是操作系统? 操作系统位于计算机硬件与应用软件之间,是一个协调.管理.控制计算机硬件资源与软件资源的控制程序.  2.为何要操作系统 ①  .控制硬件 ②  .把对硬件的复杂的操作封装成 ...

  7. 1.1(SQL学习笔记)SQL基础

    一.SELECT 建表及数据填充语句下载:链接: https://pan.baidu.com/s/1WHYafwqKJEKq1kDwCH_Zlg 提取码: 3wy4 SELECT用于指定检索返回的结果 ...

  8. openstack-cinder-netapp

    https://communities.netapp.com/docs/DOC-31749 http://docs.openstack.org/havana/config-reference/cont ...

  9. virtualbox4.2.18 ubuntu12.04 The system is running in low-graphics mode

    参考1:http://askubuntu.com/questions/225090/the-system-is-running-in-low-graphics-mode-error-in-virtua ...

  10. CentOS上安装分布式文件系统FastDFS & 配置和问题解决

    原文:https://my.oschina.net/wangmengjun/blog/1142982 什么是FastDFS? FastDFS是一个开源的分布式文件系统,她对文件进行管理,功能包括:文件 ...