[Forward] android Interface: Activity of the Title Set

android Interface: Activity of the Title Set

Articles Category: Mobile Development

1, change the subject content: public void setTitle ( CharSequence title)

2, Hide Title: requestWindowFeature (Window.FEATURE_NO_TITLE);

3, hide the title and the top bar battery and signal (full screen):

Java code

  1. public void setFullscreen () (
  2. requestWindowFeature (Window.FEATURE_NO_TITLE);
  3. getWindow (). setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
  4. WindowManager.LayoutParams.FLAG_FULLSCREEN);
  5. )

public void setFullscreen() {

4 Custom Title:

Java code

  1. protected void onCreate (Bundle savedInstanceState) (
  2. super. onCreate (savedInstanceState);
  3. / / Pre-set to allow to change the window state, be called before the setContentView, or set the title throw run-time error.
  4. requestWindowFeature (Window.FEATURE_CUSTOM_TITLE);
  5. setContentView (R.layout.custom_title);
  6. / / Header area can be set for the layout, so you can display rich way
  7. getWindow (). setFeatureInt (Window.FEATURE_CUSTOM_TITLE,
  8. R.layout.custom_title_1);
  9. )

protected void onCreate(Bundle savedInstanceState) {
// Preset allows you to change the window state, required in   setContentView  Before calling, or else set the title throw a run-time error  .
// The header area can be set to a layout, so you can have rich show way   


res \ layout \ custom_title_1.xml contains a TextView to display the title. Android can be used as a title to show the layout, with good scalability.

Java code

  1. <RelativeLayout xmlns: android = "http://schemas.android.com/apk/res/android" android: id = "@ + id / screen"
  2. android: layout_width = "fill_parent" android: layout_height = "fill_parent"
  3. android: orientation = "vertical">
  4. <TextView android: id = "@ + id / left_text"
  5. android: layout_width = "wrap_content"
  6. android: layout_height = "wrap_content"
  7. android: layout_alignParentLeft = "true"
  8. android: text = "@ string / custom_title_left" />
  9. </ RelativeLayout>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/screen"
    android:layout_width="fill_parent" android:layout_height="fill_parent"
    <TextView android:id="@+id/left_text"
        android:text="@string/custom_title_left" />
分类:Mobile 时间:2010-04-30 人气:483
blog comments powered by Disqus


  • How to use the js code or Java code jsp tag 2011-05-05

    JSP tag is still very convenient, such as Struts, Spring and other JSP tags provided to us, you can use them to get some variable or calculation. For example struts2 of <s:url value="/admin/unmi.action"/> automatically for us in front of t

  • Typical Java code for the thread pool and various parts of Features 2010-05-08

    (1) According to the xml file to manage the thread pool's maximum and minimum number of threads (2) Timer on a regular basis by scanning the thread pool to prevent the thread is not active; (3) by a single variable (in this procedure is freeThreadCou

  • Java code optimization, strategies and methods 2010-05-04

    Java code optimization, strategies and methods - Summary 1. How to Use Exception Exception decrease performance. An exception thrown first need to create a new object. Throwable interface, the constructor call, called fillInStackTrace () local method

  • Review Java code, 11 kinds of common errors 2010-09-05

    Bug code review is to eliminate one of the most important ways, these reviews are particularly effective in most of the time. As the code review itself targeted, is overlooking the entire code in the testing process problems and Bug. Also, the code r

  • java code for the return JSON or XML data (extJs) 2010-06-10

    package com.hrm.util; import java.util.ArrayList; import java.util.List; import net.sf.json.JSONObject; import com.thoughtworks.xstream.XStream; import com.thoughtworks.xstream.io.xml.DomDriver; /** * Title: Ext JS Auxiliary classes * Description: Th

  • Response implementation of the java code files to download 2010-08-27

    // This is to achieve download class (servlet), Specific ideas the code below : // Can also connect to the database package com.message; import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.util.*; public class FileDownS

  • java Code Generation 2010-05-01

    1. Generated verification code: using technology jsp, servlet 2. Generated verification code in the servlet: package servlet; import java.awt.Color; import java.awt.Font; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.I

  • java Code Code (switch) 2010-06-05

    Image generation servlet import java.awt.Color; import java.awt.Font; import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.Random; import javax.imageio.ImageIO; import javax.servlet.ServletException; import javax.servlet.

  • [Android developers] use java code in a way designed android UI layout (a) 2010-11-28

    First, the design of a test Activity, and then passed over the desired parameters, the following list box to search for an example of a description: Testing Activity: TestActivity.java public class TestActivity extends Activity { private List <String

  • Android code in Java style property set in - use the object code to create ProgressBar 2011-05-28

    In andriod development, and resources must deal with a large part, for example: pictures, layout files, strings, style, and so on. This gives us the components you want to develop some common cause great difficulties, because the public might be more

iOS 开发

Android 开发

Python 开发



PHP 开发

Ruby 开发






Javascript 开发

.NET 开发



Copyright (C) codeweblog.com, All Rights Reserved.

CodeWeblog.com 版权所有 黔ICP备15002463号-1

processed in 0.265 (s). 12 q(s)