Questions tagged [android-percent-layout]

As Android Document says Subclass of RelativeLayout that supports percentage based dimensions and margins. You can specify dimension or a margin of child by using attributes with "Percent" suffix.

It is not necessary to specify layout_width/height if you specify layout_widthPercent. However, if you want the view to be able to take up more space than what percentage value permits, you can add layout_width/height="wrap_content". In that case if the percentage size is too small for the View's content, it will be resized using wrap_content rule.

5 questions
6
votes
1 answer

PercentFrameLayout: You must supply a layout_width attribute

I try to use a PercentFrameLayout but I get this error message: Binary XML file line #: You must supply a layout_width attribute. This is the xml I use:
2
votes
1 answer

PercentFrameLayout as an item in Recycler view not working

I'm using the PercentFrameLayout as an item in RecyclerView below is my layout. PercentFrameLayout is not appearing. It's not showing up. Anything I'm missing here..?
1
vote
3 answers

How to set different percentages for Mobile & Tablets

I am currently using android.support.percent API My sample code
Ranjithkumar
  • 16,071
  • 12
  • 120
  • 159
0
votes
2 answers

Set child to have a percentage width of a parent

There are 3 LinearLayout containers with horizontal orientation. The first two LinearLayout each have 4 TextView children. The third one has only 3. I have created and assigned style to all of the TextView children. Style fragment:
-2
votes
1 answer

PercentLayoutInfo is always returning null Android

I have tried the following code to implement 'width' (in percentage) to the TextView. But I am always getting null for the PercentLayoutInfo. Please help. PercentRelativeLayout.LayoutParams lp = (PercentRelativeLayout.LayoutParams)…
Saamzzz
  • 256
  • 1
  • 14