简体   繁体   中英

Why can't I put a aligned right TextView inside a TableView?

In my layout, I really need to the TableView be the root view, but inside it I need very much a single TextView to be aligned to the right border of the screen, but I keep receiving the warning: Invalid layout param in a TableLayout: layout_alignParentRight activity_main.xml

What should I do to have a aligned textview inside a TableView?

您可以在TableLayout使用gravity ,尝试将android:gravity="right"TextView

android:layout_alignParentRight =“ true”如果不起作用,对我来说效果很好,然后检查您的父级,在父级上尝试fill_parent或尝试将其从父级布局中移出,希望这对您有所帮助

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM