Код: Выделить всё
import React, { FC } from 'react';
import { Text } from 'react-native';
import { barItemFlairStyles } from './styles/bar-item-flair';
interface BarGraphItemFlairProps {
displayedValue: number;
maxDisplayedValue?: number;
}
export const BarItemFlair: FC = ({
displayedValue,
maxDisplayedValue
}) => {
const ownStyles = barItemFlairStyles();
const displayedClampedValue = displayedValue;
return {displayedClampedValue};
};
< /code>
его стиль, в другом файле: < /p>
import { StyleSheet, TextStyle } from 'react-native';
export const barItemFlairStyles = () =>
StyleSheet.create({
flairText: {
position: 'absolute',
top: -35,
textAlign: 'center',
backgroundColor: 'blue',
} as TextStyle,
});
< /code>
Я бы ожидал, что абсолютно позиционированный элемент сможет расти за пределами родителя, если влево и вправо не определены < /p>
Явно настраиваясь влево и справа, чтобы не определить, не работает. numoflines = {1} Подробнее здесь: https://stackoverflow.com/questions/791 ... -it-may-gr
Мобильная версия