No title bar Android application without titlebar style Theme NoTitleBar Android example
Set in AndroidManifest.xml android:theme="@android:style/Theme.NoTitleBar" AndroidManifest.xml example source code.
AndroidManifest.xml
AndroidManifest.xml
<manifest xmlns:android="//schemas.android.com/apk/res/android"
package="com.myexample.without_titlebar">
<application android:label="My app">
<activity android:name="NoTitleBar"
android:theme="@android:style/Theme.NoTitleBar"
android:screenOrientation="portrait"
android:configChanges="keyboardHidden|orientation">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
396LW NO topic_id
AD
Další témata ....(Topics)
Try:
- close Eclipse and continue updating
or
- change permission of folder
or
- disable antivirus
or
- copy manually from zip packages from temp
c:\Program Files\android\sdk\temp\
c:\Program Files\android\sdk\temp\platform-tools_r19.0.1-windows.zip
c:\Program Files\android\sdk\temp\tools_r22.6.2-windows.zip
into propriety folders
or
- download all SDK package and replace old
https://developer.android.com/sdk/index.html?hl=sk
- close Eclipse and continue updating
or
- change permission of folder
or
- disable antivirus
or
- copy manually from zip packages from temp
c:\Program Files\android\sdk\temp\
c:\Program Files\android\sdk\temp\platform-tools_r19.0.1-windows.zip
c:\Program Files\android\sdk\temp\tools_r22.6.2-windows.zip
into propriety folders
or
- download all SDK package and replace old
https://developer.android.com/sdk/index.html?hl=sk
// single line
/*
multi line
*/
String[] source = {"Hello","world","by","Android"};
String[] destination = new String[source.length];
System.arraycopy(source, 0, destination, 0, source.length);
public static Bitmap createBitmap (int[] colors, int offset, int stride, int width, int height, Bitmap.Config config)
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
public void drawBitmap (Bitmap bitmap, float left, float top, Paint paint)
// //www.apache.org/licenses/LICENSE-2.0
public class MainActivity extends Activity {
private static final int WIDTH = 50;
private static final int HEIGHT = 50;
private static final int STRIDE = 64; // must be >= WIDTH
private static int[] createColors() {
int[] colors = new int[STRIDE * HEIGHT];
for (int y = 0; y < HEIGHT; y++) {
for (int x = 0; x < WIDTH; x++) {
int r = x * 255 / (WIDTH - 1);
int g = y * 255 / (HEIGHT - 1);
int b = 255 - Math.min(r, g);
int a = Math.max(r, g);
colors[y * STRIDE + x] = (a << 24) | (r << 16) | (g << 8) | b;
}
}
return colors;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(new SampleView(this));
}
private static class SampleView extends View {
// CONSTRUCTOR
public SampleView(Context context) {
super(context);
setFocusable(true);
}
@Override
protected void onDraw(Canvas canvas) {
Paint paint = new Paint();
canvas.drawColor(Color.GREEN);
int[] mColors = createColors();
int[] colors = mColors;
Bitmap bitmap = Bitmap.createBitmap(colors, 0, STRIDE, WIDTH, HEIGHT,
Bitmap.Config.RGB_565);
canvas.drawBitmap(bitmap, 50,20, paint);
}
}
}
HorizontalScrollView ScrollView LinearLayout horizontal vertical Android xml basic example and image.
[caption id="attachment_889" align="alignleft" width="200" caption="horizontal scrollview horizontalscrollview android"][/caption]
Other sample
[caption id="attachment_889" align="alignleft" width="200" caption="horizontal scrollview horizontalscrollview android"][/caption]
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:id="@+id/LinearLayout01"
android:layout_width="fill_parent" android:layout_height="fill_parent"
xmlns:android="//schemas.android.com/apk/res/android">
// horizontal and vertical Scrollview
<ScrollView android:id="@+id/ScrollView01"
android:layout_height="135px" android:layout_width="wrap_content"
android:scrollbars="horizontal|vertical">
// HorizontalScrollview
<HorizontalScrollView android:id="@+id/HorizontalScrollView01"
android:layout_height="fill_parent" android:layout_width="wrap_content">
<LinearLayout android:id="@+id/LinearLayout02"
android:layout_width="wrap_content" android:orientation="vertical"
android:layout_height="fill_parent">
<LinearLayout android:orientation="horizontal"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:text="red" android:gravity="center_horizontal"
android:background="#aa0000" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="green" android:gravity="center_horizontal"
android:background="#00aa00" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="blue" android:gravity="center_horizontal"
android:background="#0000aa" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
<TextView android:text="yellow" android:gravity="center_horizontal"
android:background="#aaaa00" android:layout_width="200px"
android:layout_height="fill_parent" android:layout_weight="1" />
</LinearLayout>
<LinearLayout android:orientation="vertical"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:layout_weight="1">
<TextView android:text="row one" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row two" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row three" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
<TextView android:text="row four" android:textSize="15pt"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:layout_weight="1" />
</LinearLayout>
</LinearLayout>
</HorizontalScrollView>
</ScrollView>
</LinearLayout>
Other sample
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="//schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/layout"
android:orientation="vertical" >
<HorizontalScrollView
android:id="@+id/horizontalScrollView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="horizontal" >
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello world! First TextView" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge" />
<TextView
android:id="@+id/textView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Medium Text"
android:textAppearance="?android:attr/textAppearanceMedium" />
</LinearLayout>
</HorizontalScrollView>
</LinearLayout>
Editace: 2011-09-20 19:28:40
Počet článků v kategorii: 396
Url:no-title-bar-android-application-without-titlebar-style-theme-notitlebar-android-example