前言
         欢迎大家我分享和推荐好用的代码段~~
声明
         欢迎转载,但请保留文章原始出处:
         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. [thinkphp] 隐藏后台地址

    转自 http://document.thinkphp.cn/manual_3_2.html#module_deploy 如果不希望用户直接访问某个模块,可以设置模块映射(对后台的保护会比较实用). ...

  2. 转:Google Project Zero挖洞经验整理

    https://www.sec-un.org/google-project-zero%E6%8C%96%E6%B4%9E%E7%BB%8F%E9%AA%8C%E6%95%B4%E7%90%86/ 1. ...

  3. Python函数式编程——map()、reduce()

    文章来源:http://www.pythoner.com/46.html 提起map和reduce想必大家并不陌生,Google公司2003年提出了一个名为MapReduce的编程模型[1],用于处理 ...

  4. Matrix Zigzag Traversal(LintCode)

    Matrix Zigzag Traversal Given a matrix of m x n elements (m rows, ncolumns), return all elements of ...

  5. Luogu P3391 【模板】文艺平衡树(FHQ-Treap)

    题意 给出一个长为$n$序列$[1,2,...,n]$,$m$次操作,每次指定一段区间$[l,r]$,将这段区间翻转,求最终序列 题解 虽然标题是$Splay$,但是我要用$FHQ\ Treap$,考 ...

  6. js中ajax的异步性

    最近项目里遇到ajax异步性的问题,简化后的代码如下: function ajaxGetEvents(calendarView, time) { var year = time.getFullYear ...

  7. AtCoder - 3954 Painting Machines

    题面在这里! 题解见注释 /* 考虑一个可以用 K ((n+1)/2 <= K < n)次染黑的方案, 那么将操作前K次的机器从小到大排序,一定是: a1=1 < a2 < . ...

  8. 【BFS】Pots

    [poj3414]Pots Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 16925   Accepted: 7168   ...

  9. [转]ibatis中井号跟美元符号区别(#、$)

    Mybatis中如何在SQL语句表名中使用参数 insert into prefix_${table_name} (a, b, c) values (#{a}, #{b}, #{c}) ${} 表示直 ...

  10. Codeforces Round #345 (Div. 2) E. Table Compression 并查集

    E. Table Compression 题目连接: http://www.codeforces.com/contest/651/problem/E Description Little Petya ...