Arka Plan, Kenarlık ve Kırpma
Renkler, ana hatlar ve yuvarlatılmış şekiller ekleyin.
Arka Plan, Kenarlık ve Kırpma, CoddyKit'te ücretsiz bir Jetpack Compose Academy dersidir. Bu, 4 dersinin 2. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Jetpack Compose Academy öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.
Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.
Decorate with Modifiers
Beyond sizing, modifiers can decorate a Composable. You can paint a background, draw a border, and round its corners. 🎨
Add a Background
background fills a Composable with a solid color. It paints the whole area the element occupies, including its size and fill.
Modifier.background(Color.Blue)Use Theme Colors
Prefer theme colors over raw values. Pulling from MaterialTheme keeps your app consistent in light and dark mode.
Modifier.background(
MaterialTheme.colorScheme.primary
)Draw a Border
Use border to outline a Composable. Give it a thickness in dp and a color, and Compose draws the edge for you.
Modifier.border(2.dp, Color.Gray)Meet Shapes
A Shape describes an outline like rounded or circular. Both background and border accept a shape to change their silhouette.
Rounded Corners
RoundedCornerShape softens corners by a radius in dp. It is the go-to shape for cards, buttons, and chips.
RoundedCornerShape(12.dp)Shaped Background
Pass a shape to background and the color fills only inside that outline, giving you a tidy rounded panel.
Modifier.background(
Color.LightGray,
RoundedCornerShape(12.dp)
)Clip the Content
clip trims anything drawn outside a shape. Use it so images and children respect your rounded corners.
Modifier.clip(RoundedCornerShape(12.dp))Make a Circle
Reach for CircleShape when you want a perfect circle, like a round avatar or a floating button.
Modifier.clip(CircleShape)Clip Before Drawing
Place clip before background so the fill is also rounded. Order in the chain decides what gets clipped.
Modifier
.clip(RoundedCornerShape(12.dp))
.background(Color.Cyan)Combine for a Card
Stack clip, background, and border together to craft a polished card surface in just a few lines.
Modifier
.clip(RoundedCornerShape(16.dp))
.background(Color.White)
.border(1.dp, Color.LightGray)Quick Check
You want a rounded background where the fill itself is also rounded. Which modifier ensures that?
Recap
You can now style any element: background paints it, border outlines it, and clip with a Shape rounds it. 🎉
Sıkça Sorulan Sorular
“Arka Plan, Kenarlık ve Kırpma” dersi ücretsiz mi?
Evet — “Arka Plan, Kenarlık ve Kırpma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Jetpack Compose Academy kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Jetpack Compose Academy kursu toplamda 4 dersten oluşur.
“Arka Plan, Kenarlık ve Kırpma” dersinde ne öğreneceğim?
Renkler, ana hatlar ve yuvarlatılmış şekiller ekleyin. Jetpack Compose Academy ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.
Jetpack Compose Academy öğrenmeye başlamak için deneyim gerekli mi?
Önceden deneyim gerekmez. CoddyKit'te Jetpack Compose Academy, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 2. dersidir.
“Arka Plan, Kenarlık ve Kırpma” dersi ne kadar sürer?
Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.
Bu Jetpack Compose Academy dersinde kod yazıp çalıştırabilir miyim?
Evet. Her Jetpack Compose Academy dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.
Bu kursun tüm dersleri
- Padding, Boyut ve fillMaxWidth
- Arka Plan, Kenarlık ve Kırpma
- Modifier Sırası Neden Önemlidir
- weight ve Esnek Boyutlandırma