Okhelp.cz

Recepty, články, nápady, programování. Dříve dum-zahrada, finance, internet a know-how.okhelp.cz Pro lepší výsledky hledání používejte i diakritiku.

Center View in RelativeLayout Android



RelativeLayout like parent, child Srollview is centered horizontal.
Second RelativeLayout in SrollView have gravity center, every child will centered horizontally and vertically.


<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="//schemas.android.com/apk/res/android"
    android:layout_width="match_parent" android:layout_height="match_parent"
    android:gravity="center_horizontal">

    <ScrollView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/scrollView2" >

        <RelativeLayout
            android:layout_width="320dp"
            android:layout_height="wrap_content"
            android:background="#e6f825"
            android:gravity="center">

            <Button
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="New Button"
                android:id="@+id/button" />
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>

397LW NO topic_id



Další témata ....(Topics)


203

Samsung Galaxy Y (S5360) | samsung-galaxy-y-s5360






























Brand Samsung
Model (codename) Galaxy Y (S5360)
Cena, včetně DPH 2400 / 06.2012
Display size (v palcích) 3
Display-resolution 240x320
Dotek-typ kapacitní
CPU typ BCM21553
CPU MHz 832
CPU core
L2 cache ?
RAM 256
ROM 512
GPU VideoCore IV
NenaMark2 Benchmark 12
GPU-GLBenchmark
Baterie mAh 1200
Foto MPx 2
Autofocus ne
Video
Official Android ICS Android OS v 2.3
CyanogenMod support
Dotek-prstů-max
Display-ppi 133
Display-retina 41%
Network čîtyřpásmový GSM 850/900/1800/1900 MHz , HSDPA 2100 MHz
Connectivity Bluetooth v2.0 plus EDR plus support A2DP, USB host
Pozn. CPU ARMv6, GPU 20MT/s OpenGL ES 2.0


samsung galaxy y smartphone
263

Iterate over each Entry in Map Java Android | iterate-over-each-entry-in-map-java-android


entry put iterate Map HashMap Java Android

Map<String, Integer> map = new HashMap<String, Integer>();
map.put("key27", 27);
for (Map.Entry<String, Integer> entry : map.entrySet())
{
 String str = entry.getKey();
 int n = entry.getValue();
}
284

Open Save UTF-8 File To String Java Android Code | open-save-utf-8-file-to-string-java-android-code



String sFileContent = readFile("myfile.txt",StandardCharsets.UTF_8);

	static String readFile(String path, Charset encoding) 
		  throws IOException 
		{
		  byte[] encoded = Files.readAllBytes(Paths.get(path));
		  return encoding.decode(ByteBuffer.wrap(encoded)).toString();
		}

// write file
String sOut = "text blah hello world etc.";
		writeToFile(sOut"someName.txt");	
	static void writeToFile(String sB,String name) {
		String folder = ("c:\\folder\\");
		File f = new File(folder+ name);
		BufferedWriter writer = null;
			writer = new BufferedWriter( new OutputStreamWriter(
                           new FileOutputStream( folder+name),"UTF-8"));
			writer.write( sB);

				if ( writer != null)
					writer.close( );
	}

195

Samsung Galaxy S III - Android | samsung-galaxy-s-iii-android


Špičkový smartphone od Samsungu.

Technické parametry Samsung i9300 Galaxy S III
Rozměry a hmotnost: 137 x 71 x 9 mm, 133 gramů
Datové funkce: GPS modul, WiFi, Bluetooth, NFC, GPRS, EDGE, HSCSD, Hardwarový modem, Infraport
Sítě: pásma GSM 850, 900, 1 800, 1 900 MHz pásma WCDMA (3G) 850, 900, 1 900, 2 100 MHz
Displej: HD Super AMOLED diplej o velikosti 1280x720 4,8 palců
Procesor: čtyřjádrový procesor 1.4 GHz
Uživatelská paměť: 16 MB
paměť RAM 1 024 MB
Operační systém: Android 4.0 ICS
Hudba: MP3
Video: HD rozlišení
Fotoaparát: 8 Mpix
Navigace:
Baterie: Li-Pol, pohotovostní doba 390 hodin
Cena: cca 14.500 korun / léto 2012

Samsung i9300 Galaxy S III obrázek
samsung-i9300-galaxy-s-III
204

Samsung Galaxy Mini (S5570) | samsung-galaxy-mini-s5570






























Brand Samsung
Model (codename) Galaxy Mini (S5570)
Price (cena, včetně DPH) 3500 / 06.2012
Display size in Inch (v palcích) 3.14
Display-resolution 240x320
Dotek-typ kapacitní
CPU typ MSM7227
CPU MHz 600
CPU core
L2 cache yes
RAM 256
ROM 512
GPU Adreno 200
NenaMark2 Benchmark
GPU-GLBenchmark
Baterie mAh 1200
Foto MPx 3
Autofocus no
Video QVGA (320 x 240) při 15 frames/s
Official Android ICS Android Froyo 2.2
CyanogenMod support yes
Dotek-prstů-max Dual-touch (two fingers)
Display-ppi 127
Display-retina 39%
Networks GSM&EDGE (850 / 900 / 1.800 / 1.900 MHz) 3G (900 / 2.100 MHz)
Connectivity Bluetooth V2.1 , USB V2.0 , USB mass storage , SyncML(DM) , WIFI , AGPS, 3.5 mm jack
Note


Samsung S5570 Galaxy Mini - image
samsung-s5570-galaxy-mini


Editace Jana Žákovská : 2016-03-14 17:39:25
Počet článků v kategorii: 397
Url:center-view-in-relativelayout-android
Share
Share
Tweet