frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

HarmonyOS Next Element Positioning

3•flfljh•5h ago
### Introduction

In HarmonyOS Next, child elements use the *.position()* attribute for relative positioning within parent elements. Usage example:

``` @Entry @Component struct PositionExample1 { build() { Column() { Row() {

        }
        .position({x: 50, y: 50})
    }
    .width('100%')
    .height('100%')
  }
} ```

This positions the child element 50 units from the parent's left and top edges.

A common challenge is positioning elements near the right edge, especially given the diverse screen sizes across devices. How can we ensure consistent positioning across different devices?

We propose a solution using the LocalizedEdges type. This approach accounts for device diversity by:

1. Identifying device types 2. Adapting to screen dimensions 3. Maintaining consistent positioning across devices

### Solution

Official documentation: \#position

Use LocalizedEdges for positioning relative to parent container edges, with mirroring support. This is ideal for:

- Fixed-position elements - Floating action buttons - Top-aligned components - Edge-sensitive designs

Example of bottom-right positioning:

``` @Entry @Component struct PositionExample1 { build() { Column() { Row() {

        }
        // bottom: Offset from bottom edge
        // end: Offset from right edge (supports RTL mirroring)
        .position(bottom: { value: 20, unit: 2 }, end: { value: 20, unit: 2 })
    }
    .width('100%')
    .height('100%')
  }
} ```

Key features:

- `unit: 2` specifies percentage-based positioning - Works consistently across all screen sizes - Automatically adjusts for right-to-left languages - Maintains design integrity on any device

This concludes our overview of advanced positioning techniques in HarmonyOS Next.

Agent Lineage Evolution: A Novel Framework for Managing LLM Agent Degradation

https://danieltan.weblog.lol/2025/06/agent-lineage-evolution-a-novel-framework-for-managing-llm-agent-degradation
1•danieltanfh95•4m ago•1 comments

Show HN: A Free, Offline-First Cash Register That Runs in the Browser

https://takeasale.com/
1•gerardojbaez•4m ago•0 comments

Twenty (Open Source CRM) is out of beta

https://twenty.com/releases
1•pavl•8m ago•0 comments

More time in bed benefits morning and evening-type teens differently

https://www.psypost.org/more-time-in-bed-benefits-morning-and-evening-type-teens-differently-new-study-suggests/
1•lentoutcry•10m ago•0 comments

Clerk is down, and so are all apps using it

https://status.clerk.com
3•cheerioty•11m ago•0 comments

Donate Less

https://blogs.gnome.org/steven/2025/06/26/donate-less/
1•edent•12m ago•0 comments

Show HN: Mind maps in Visual Studio and VS Code with nodes linked to source code

https://codemindmap.com/
1•kentich•12m ago•0 comments

Pro-Indy accounts go dark after Israeli strikes

https://ukdefencejournal.org.uk/dozens-of-pro-indy-accounts-go-dark-after-israeli-strikes/
1•doener•13m ago•0 comments

We increased Roblox game profits by 30% using overlooked economic patterns

https://medium.com/@untouchable/theres-a-hidden-30-in-your-game-we-found-it-b394d5757163
5•HaunChangpeng•17m ago•1 comments

Clerk Is Down

https://clerk.com
1•wonderfuly•18m ago•0 comments

Show HN: Meeting Waste Calculator – See the Real Cost of Your Meetings

https://gitdigest.ai/meeting-waste
1•RaulOnRails•19m ago•0 comments

Seniors in Wheelchairs Zip-Tied and Arrested During Senate Budget Protest

https://centeredamerica.substack.com/p/breaking-seniors-in-wheelchairs-zip
1•lentoutcry•20m ago•0 comments

The European wood pigeon helped me appreciate its omnipresent city cousins

https://www.nytimes.com/2025/06/24/magazine/pigeons-city-nature.html
1•Thevet•21m ago•0 comments

Oldest boomerang doesn't come back

https://www.bbc.co.uk/news/articles/cren818q5x1o
2•ljf•24m ago•0 comments

Highbrow Climate Misinformation

https://josephheath.substack.com/p/highbrow-climate-misinformation
1•af78•27m ago•0 comments

CLI coding agents battle royale

https://twitter.com/SIGKITTEN/status/1937950811910234377
2•freediver•31m ago•0 comments

Amazon's Ring can now use AI to 'learn the routines of your residence'

https://www.theregister.com/2025/06/25/amazons_ring_ai_video_description/
3•detaro•32m ago•1 comments

A space for all people interested in gold and gold trading

https://www.xau-usd.space/
2•nonplayercaesar•35m ago•0 comments

Reverse Engineering the Microchip CLB Part 1: Background and Reverse Engineerin

http://mcp-clb.markomo.me/P1-Background-and-RE/
2•todsacerdoti•36m ago•0 comments

Gemini Users: We're Going to Look at Your Texts Whether You Like It or Not

https://gizmodo.com/google-to-gemini-users-were-going-to-look-at-your-texts-whether-you-like-it-or-not-2000620141
2•miles•37m ago•0 comments

Changes to Cody Free, Pro, and Enterprise Starter Plans

https://sourcegraph.com/blog/changes-to-cody-free-pro-and-enterprise-starter-plans
1•ingve•37m ago•0 comments

Yes, I will judge you for using AI

https://jaysthoughts.com/aithoughts1
26•CoffeeOnWrite•38m ago•13 comments

Weight loss and diabetes jabs linked to potentially fatal side effect

https://news.sky.com/story/weight-loss-and-diabetes-jabs-linked-to-potentially-fatal-side-effect-13388528
2•austinallegro•40m ago•0 comments

Work begins to create artificial human DNA from scratch

https://www.bbc.co.uk/news/articles/c6256wpn97ro
1•iamphilrae•42m ago•0 comments

Akinator Made with Claude Artifacts

https://claude.ai/public/artifacts/3cebb65f-a869-4dd8-9a89-63513e4830f7
1•ehdehdrb•45m ago•1 comments

Show HN: Frametwo – Tired of my videos getting flagged, so I built this

https://frametwo.com/
2•andrewjustus•45m ago•0 comments

Internals of Command Line AI Agents and Their Influence

https://multitasked.net/2025/06/26/internals-of-command-line-ai.html
2•madewulf•51m ago•0 comments

Ask HN: New Grad Seeking Tech Role – Data, ML, SDE or AI (Portfolio Inside)

1•ChengyangShen•56m ago•0 comments

Bumble's AI icebreakers are mainly breaking EU law

https://noyb.eu/en/bumbles-ai-icebreakers-are-mainly-breaking-eu-law
5•dotcoma•59m ago•0 comments

Canadian telecom hacked by suspected China state group

https://arstechnica.com/security/2025/06/suspected-china-state-hackers-exploited-patched-flaw-to-breach-canadian-telecom/
3•emptybits•59m ago•0 comments